aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-07 10:39:19 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-07 10:39:19 -0400
commitc97f531abfb3053317b10d605eabf3aaaabab413 (patch)
treec102e9904e128e6bbd3ff4e86449366b6abf9dd3 /modules
parentb1af2bb28476440eb10716e6b734b0d4e68bc57a (diff)
Added `ui.find.active` and prevent word highlighting when searching.
Word auto-highlighting when searching is too distracting.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/editing.lua4
-rw-r--r--modules/textadept/find.lua2
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 1830e047..5b39c1bc 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -165,7 +165,7 @@ end, 1) -- need index of 1 because default key handler halts propagation
-- Highlights matching braces.
events.connect(events.UPDATE_UI, function(updated)
- if updated and updated & 3 == 0 then return end -- ignore scrolling
+ if updated & 3 == 0 then return end -- ignore scrolling
local pos = buffer.selection_n_caret[buffer.main_selection]
if M.brace_matches[buffer.char_at[pos]] then
local match = buffer:brace_match(pos, 0)
@@ -187,7 +187,7 @@ end, 1)
-- Highlight all instances of the current or selected word.
events.connect(events.UPDATE_UI, function(updated)
- if not updated or updated & buffer.UPDATE_SELECTION == 0 then return end
+ if updated & buffer.UPDATE_SELECTION == 0 or ui.find.active then return end
local word
if M.highlight_words == M.HIGHLIGHT_CURRENT then
clear_highlighted_words()
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index 520b977e..d5e34ca9 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -57,6 +57,8 @@ local M = ui.find
-- @field in_files_label_text (string, Write-only)
-- The text of the "In files" label.
-- This is primarily used for localization.
+-- @field active (boolean)
+-- Whether or not the Find & Replace pane is active.
-- @field highlight_all_matches (boolean)
-- Whether or not to highlight all occurrences of found text in the current
-- buffer.