From 18e3542be09c5208178f3a26e8767b8117caca23 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Mon, 26 Dec 2022 18:41:14 +0100 Subject: [PATCH] Allow `TreeView` file operation commands when focused (#1256) 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`. --- data/plugins/treeview.lua | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/data/plugins/treeview.lua b/data/plugins/treeview.lua index 023bcb25..dee02846 100644 --- a/data/plugins/treeview.lua +++ b/data/plugins/treeview.lua @@ -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