From 6b82a6288fe1775f63894882ba9b1a9727780b45 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Wed, 21 Oct 2020 10:05:20 -0400 Subject: Do not clear or perform find result highlighting in "Find in Files" buffer. When manually searching inside this buffer, leave existing highlights alone. --- modules/textadept/find.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 7ea83e18..1a31eebd 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -158,6 +158,7 @@ local function is_ff_buf(buf) return buf._type == _L['[Files Found Buffer]'] end -- Clears highlighted match indicators. local function clear_highlighted_matches() + if is_ff_buf(buffer) then return end buffer.indicator_current = M.INDIC_FIND buffer:indicator_clear_range(1, buffer.length) end @@ -237,7 +238,7 @@ local function find(text, next, flags, no_wrap, wrapped) while buffer:search_in_target(text) ~= -1 do local s, e = buffer.target_start, buffer.target_end if s == e then e = e + 1 end -- prevent loops for zero-length results - if M.highlight_all_matches and e - s > 1 then + if M.highlight_all_matches and e - s > 1 and not is_ff_buf(buffer) then buffer:indicator_fill_range(s, e - s) end buffer:set_target_range(e, buffer.length + 1) -- cgit v1.2.3