Skip to content

Commit

Permalink
Allow TreeView file operation commands when focused (lite-xl#1256)
Browse files Browse the repository at this point in the history
Impacts `treeview:{rename,new-file,new-folder,open-in-system}`.
Previously those were only available when the mouse was over the 
`TreeView`.
They now use the same predicate as `treeview:delete`.
  • Loading branch information
Guldoman authored and takase1121 committed Jan 16, 2023
1 parent 651d67a commit 1746c07
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions data/plugins/treeview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -714,16 +714,8 @@ command.add(
end
end
)
end
})

end,

command.add(function()
if not (core.root_view.overlapping_node and core.root_view.overlapping_node.active_view) then return end
if core.root_view.overlapping_node.active_view ~= view then return end
local item = treeitem()
return item ~= nil, item
end, {
["treeview:rename"] = function(item)
local old_filename = item.filename
local old_abs_filename = item.abs_filename
Expand Down

0 comments on commit 1746c07

Please sign in to comment.