From 4bd98e0e20a5752155dbcf43964d0345e4eaa219 Mon Sep 17 00:00:00 2001 From: Konrad Malik Date: Fri, 8 Nov 2024 22:31:33 +0100 Subject: [PATCH] feat: add lsp rename file handlers to neo-tree --- config/native/plugin/neo-tree.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/native/plugin/neo-tree.lua b/config/native/plugin/neo-tree.lua index e45cb98..6efafd4 100644 --- a/config/native/plugin/neo-tree.lua +++ b/config/native/plugin/neo-tree.lua @@ -8,8 +8,11 @@ keymap.set( opts_with_desc("Toggle") ) +local events = require("neo-tree.events") local neo_tree = require("neo-tree") +local function on_move(data) Snacks.rename.on_rename_file(data.source, data.destination) end + neo_tree.setup({ sources = { "filesystem", @@ -32,4 +35,8 @@ neo_tree.setup({ enabled = true, }, }, + event_handlers = { + { event = events.FILE_MOVED, handler = on_move }, + { event = events.FILE_RENAMED, handler = on_move }, + }, })