Avoid exposing `treeview` commands when not usable

This commit is contained in:
Guldoman 2021-09-02 19:12:26 +02:00 committed by Francesco Abbate
parent 9887dd4746
commit 3278eebdad
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