From b821d05d828aec6ac6c070f00c9115f27f62f9c0 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 13 Jul 2020 20:58:46 -0400 Subject: Limit word highlighting to single words. --- core/ui.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/ui.lua b/core/ui.lua index 5ee4fbd1..e7e608de 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -304,7 +304,8 @@ end, 1) events_connect(events.UPDATE_UI, function(updated) if updated and updated & buffer.UPDATE_SELECTION > 0 and ui.highlight_words and not buffer.selection_empty and - buffer:is_range_word(buffer.selection_start, buffer.selection_end) then + buffer:is_range_word(buffer.selection_start, buffer.selection_end) and + buffer:get_sel_text():find('^%S+$') then clear_highlighted_words() local word = buffer:text_range(buffer.selection_start, buffer.selection_end) buffer.search_flags = buffer.FIND_MATCHCASE | buffer.FIND_WHOLEWORD -- cgit v1.2.3