Apply `doc` commands to anything that extends `DocView`

This fixes a regression caused by 
cf29a6a45f.
This commit is contained in:
Guldoman 2022-10-24 04:47:26 +02:00
parent 76f55aefe8
commit 715411061b
No known key found for this signature in database
GPG Key ID: EA928C8BDA1A8825
1 changed files with 1 additions and 1 deletions

View File

@ -538,7 +538,7 @@ local commands = {
} }
command.add(function(x, y) command.add(function(x, y)
if x == nil or y == nil or not core.active_view:is(DocView) then return false end if x == nil or y == nil or not core.active_view:extends(DocView) then return false end
local dv = core.active_view local dv = core.active_view
local x1,y1,x2,y2 = dv.position.x, dv.position.y, dv.position.x + dv.size.x, dv.position.y + dv.size.y local x1,y1,x2,y2 = dv.position.x, dv.position.y, dv.position.x + dv.size.x, dv.position.y + dv.size.y
return x >= x1 + dv:get_gutter_width() and x < x2 and y >= y1 and y < y2, dv, x, y return x >= x1 + dv:get_gutter_width() and x < x2 and y >= y1 and y < y2, dv, x, y