nvim-tree / nvim-tree/nvim-tree.lua
Prevent nvim-tree From Polluting Jump Lists
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 8.6k
- Forks
- 639
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 2
Description
Hi, sorry to use black issue templete.
nvim-tree uses NvimTree_1 as default name, this will be keeped in jumplist,if it is openned by jumps picker, and save file. this will create a real file, and then open nvim-tree you will get this error:
"NvimTree_1" line 8 of 9 --88%-- col 7-5
"NvimTree_1" [New] --No lines in buffer--
"NvimTree_1" line 8 of 9 --88%-- col 7-5
"NvimTree_1" [New] --No lines in buffer--
"NvimTree_1" line 8 of 9 --88%-- col 7-5
"NvimTree_1" [New] --No lines in buffer--
"NvimTree_1" [New] 0L, 0B written
[NvimTree] Cannot rename C:\Users\wsdjeg\AppData\Local\nvim\init.lua -> C:\Users\wsdjeg\AppData\Local\nvim\init.lua: file already exists
Error executing Lua callback: ...undle_dir\nvim-tree\nvim-tree.lua/lua/nvim-tree/view.lua:104: Vim:E95: Buffer with this name already exists
stack traceback:
[C]: in function 'nvim_buf_set_name'
...undle_dir\nvim-tree\nvim-tree.lua/lua/nvim-tree/view.lua:104: in function 'create_buffer'
...undle_dir\nvim-tree\nvim-tree.lua/lua/nvim-tree/view.lua:292: in function 'open'
D:\bundle_dir\nvim-tree\nvim-tree.lua/lua/nvim-tree/lib.lua:34: in function 'open_view_and_draw'
D:\bundle_dir\nvim-tree\nvim-tree.lua/lua/nvim-tree/lib.lua:129: in function 'open'
...tree\nvim-tree.lua/lua/nvim-tree/actions/tree/toggle.lua:48: in function 'toggle'
...e_dir\nvim-tree\nvim-tree.lua/lua/nvim-tree/commands.lua:36: in function <...e_dir\nvim-tree\nvim-tree.lua/lua/nvim-tree/commands.lua:35>
is it possile to use empty buffer name?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lua/nvim-tree/view.lua at create_buffer, especially line 104, and reproduce the jumps-picker and save-file workflow described in the issue. Check how the NvimTree_1 buffer name affects the jump list and reopening the tree; done means the workflow no longer creates the conflicting file or raises the reported E95 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100