Skip to content

fix(clipboard): exception when pasting into an empty directory when root_folder_label = false - #3365

Merged
alex-courtis merged 1 commit into
nvim-tree:masterfrom
dotbillu:fix/clipboard-nill-node
Oct 18, 2026
Merged

alex-courtis merged 1 commit into
nvim-tree:masterfrom
dotbillu:fix/clipboard-nill-node

Conversation

@dotbillu

@dotbillu dotbillu commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Issue

  • p/gp in a empty directory returns nil value as focused line is blank which was failing do_paste.
E5108: Lua: ...azy/nvim-tree.lua/lua/nvim-tree/actions/fs/clipboard.lua:360: attempt to index local 'node' (a nil value)                                                     
stack traceback:                                                                                                                                                             
        ...azy/nvim-tree.lua/lua/nvim-tree/actions/fs/clipboard.lua:360: in function 'do_paste'                                                                              
        ...azy/nvim-tree.lua/lua/nvim-tree/actions/fs/clipboard.lua:451: in function 'paste'                                                                                 
        ...share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/api/impl.lua:165: in function <...share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/api/impl.lua:165>    

Fix

  • simply fall back to self.explorer.

@alex-courtis

Copy link
Copy Markdown
Member

Replicate with root_folder_label = false. Assuming that is the use case.

Next time please include config in the issue/PR description for clearer replication as per bug report template or Troubleshooting

@alex-courtis alex-courtis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for your contribution! Fix works as intended.

@alex-courtis alex-courtis changed the title fix(clipboard): default to root when pasting without focused node fix(clipboard): exception when pasting into an empty directory when root_folder_label = false Oct 18, 2026
@alex-courtis
alex-courtis merged commit 0142ac3 into nvim-tree:master Oct 18, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants