Avoid exposing `treeview` commands when not usable
This commit is contained in:
parent
9887dd4746
commit
3278eebdad
|
@ -437,8 +437,10 @@ menu:register(
|
||||||
command.add(nil, {
|
command.add(nil, {
|
||||||
["treeview:toggle"] = function()
|
["treeview:toggle"] = function()
|
||||||
view.visible = not view.visible
|
view.visible = not view.visible
|
||||||
end,
|
end})
|
||||||
|
|
||||||
|
|
||||||
|
command.add(function() return view.hovered_item ~= nil end, {
|
||||||
["treeview:rename"] = function()
|
["treeview:rename"] = function()
|
||||||
local old_filename = view.hovered_item.filename
|
local old_filename = view.hovered_item.filename
|
||||||
local old_abs_filename = view.hovered_item.abs_filename
|
local old_abs_filename = view.hovered_item.abs_filename
|
||||||
|
|
Loading…
Reference in New Issue