Check the entire path in `TreeView` predicate

This commit is contained in:
Guldoman 2021-11-28 07:16:53 +01:00
parent 7b82d787c0
commit ef4c02ab0e
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
1 changed files with 2 additions and 2 deletions

View File

@ -406,7 +406,7 @@ function RootView:draw(...)
end end
local function is_project_folder(path) local function is_project_folder(path)
return common.basename(core.project_dir) == path return core.project_dir == path
end end
menu:register(function() return view.hovered_item end, { menu:register(function() return view.hovered_item end, {
@ -417,7 +417,7 @@ menu:register(function() return view.hovered_item end, {
menu:register( menu:register(
function() function()
return view.hovered_item return view.hovered_item
and not is_project_folder(view.hovered_item.filename) and not is_project_folder(view.hovered_item.abs_filename)
end, end,
{ {
{ text = "Rename", command = "treeview:rename" }, { text = "Rename", command = "treeview:rename" },