Avoid exposing `treeview` commands when not usable

This commit is contained in:
Guldoman 2021-09-02 19:12:26 +02:00 committed by Francesco
parent 167cda23f6
commit f18629ab64
1 changed files with 3 additions and 1 deletions

View File

@ -437,8 +437,10 @@ menu:register(
command.add(nil, {
["treeview:toggle"] = function()
view.visible = not view.visible
end,
end})
command.add(function() return view.hovered_item ~= nil end, {
["treeview:rename"] = function()
local old_filename = view.hovered_item.filename
local old_abs_filename = view.hovered_item.abs_filename