Skip to content

Commit 3f1dd2d

Browse files
Sedonnpynappo
andauthored
fix(renderer): fix cut & paste stack overflow on hidden root (#1792)
Closes #1517 Co-authored-by: pynappo <pynappo@proton.me>
1 parent 56f383a commit 3f1dd2d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lua/neo-tree/ui/renderer.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ local keymap = require("nui.utils.keymap")
1010
local autocmd = require("nui.utils.autocmd")
1111
local log = require("neo-tree.log")
1212
local windows = require("neo-tree.ui.windows")
13+
local nt = require("neo-tree")
1314

1415
local M = { resize_timer_interval = 50 }
1516
local ESC_KEY = utils.keycode("<ESC>")
@@ -657,9 +658,15 @@ M.position = {
657658
end
658659
end,
659660
set = function(state, node_id)
660-
if not type(node_id) == "string" and node_id > "" then
661+
if type(node_id) ~= "string" or node_id == "" then
661662
return
662663
end
664+
if state.tree then
665+
local node = state.tree:get_node(node_id)
666+
if node and node.skip_node then
667+
return
668+
end
669+
end
663670
state.position.node_id = node_id
664671
end,
665672
clear = function(state)

0 commit comments

Comments
 (0)