aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-21 10:05:20 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-21 10:05:20 -0400
commit6b82a6288fe1775f63894882ba9b1a9727780b45 (patch)
treea3ab1376ee48eec2e15d55fc86d7d9d97cb0611b /modules
parent03c4016d07477781aa3adcc9edf340c0bec9c6c8 (diff)
Do not clear or perform find result highlighting in "Find in Files" buffer.
When manually searching inside this buffer, leave existing highlights alone.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/find.lua3
1 files changed, 2 insertions, 1 deletions
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)