Avoid checking for unique selections on non-`DocView`s

This commit is contained in:
Guldoman 2021-09-01 16:29:47 +02:00
parent 06b64f2928
commit f31312fd16
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
1 changed files with 2 additions and 1 deletions

View File

@ -97,6 +97,7 @@ local function has_selection()
end 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 local text = nil
for idx, line1, col1, line2, col2 in doc():get_selections(true, true) do for idx, line1, col1, line2, col2 in doc():get_selections(true, true) do
if line1 == line2 and col1 == col2 then return false end if line1 == line2 and col1 == col2 then return false end