plugin contextmenu: simplify predicate

This commit is contained in:
jgmdev 2022-05-15 17:17:28 -04:00
parent ac1d15f235
commit 26e47f7583
1 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@ local core = require "core"
local command = require "core.command"
local keymap = require "core.keymap"
local ContextMenu = require "core.contextmenu"
local DocView = require "core.docview"
local RootView = require "core.rootview"
local menu = ContextMenu()
@ -33,7 +32,7 @@ function RootView:draw(...)
menu:draw()
end
command.add(function() return getmetatable(core.active_view) == DocView end, {
command.add("core.docview!", {
["context:show"] = function()
menu:show(core.active_view.position.x, core.active_view.position.y)
end