aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2021-09-01 16:29:47 +0200
committerGuldoman <giulio.lettieri@gmail.com>2021-09-01 16:29:47 +0200
commitf31312fd16b8d7d4f7b00b910d3ce1c1dde2e95f (patch)
tree16e9a4effc3c64e03b2a7a22e6c337b61163a7b4
parent06b64f29288a82dc0100fc70f5c78e34a231048c (diff)
downloadlite-xl-f31312fd16b8d7d4f7b00b910d3ce1c1dde2e95f.tar.gz
lite-xl-f31312fd16b8d7d4f7b00b910d3ce1c1dde2e95f.zip
Avoid checking for unique selections on non-`DocView`s
-rw-r--r--data/core/commands/findreplace.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/data/core/commands/findreplace.lua b/data/core/commands/findreplace.lua
index b9a424fa..48cbecaf 100644
--- a/data/core/commands/findreplace.lua
+++ b/data/core/commands/findreplace.lua
@@ -96,7 +96,8 @@ local function has_selection()
return core.active_view:is(DocView) and core.active_view.doc:has_selection()
end
-local function has_unique_selection()
+local function has_unique_selection()
+ if not core.active_view:is(DocView) then return false end
local text = nil
for idx, line1, col1, line2, col2 in doc():get_selections(true, true) do
if line1 == line2 and col1 == col2 then return false end