Skip to content

Commit

Permalink
feat: add lsp rename file handlers to neo-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
konradmalik committed Nov 8, 2024
1 parent f78c722 commit 4bd98e0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/native/plugin/neo-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 },
},
})

0 comments on commit 4bd98e0

Please sign in to comment.