Avoid checking for unique selections on non-`DocView`s
This commit is contained in:
parent
b7f2d1ad03
commit
de4072e207
|
@ -96,7 +96,8 @@ local function has_selection()
|
||||||
return core.active_view:is(DocView) and core.active_view.doc:has_selection()
|
return core.active_view:is(DocView) and core.active_view.doc: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
|
||||||
|
|
Loading…
Reference in New Issue