luukvbaal / nnn.nvim

File manager for Neovim powered by nnn.
BSD 3-Clause "New" or "Revised" License
427 stars 9 forks source link

:vsplit and :edit a folder doesn't work #32

Closed FabioAntunes closed 2 years ago

FabioAntunes commented 2 years ago

Hi,

I have been trying nnn for the past few days as an alternative to the existing tree plugins and netrw. Thanks for all your hard work!

Something that I tend to do a lot is to use :vsplit and have multiple buffers side by side.

If I run :vsplit and after that, I try to edit a folder on the new buffer :e /some-folder/ nnn is triggered but any selection from the nnn will throw out an error when in explorer mode and it silently fails in picker mode.

Picker mode: https://asciinema.org/a/wAiGWbpjmutXfbx8mgKKlEwey I open a :vsplit, that it's closed by nnn when I :edit a folder and when I pick a different file init.vim nothing happens

Explorer mode 1: https://asciinema.org/a/wAiGWbpjmutXfbx8mgKKlEwey I have nnn tree open. I open a :vsplit and then :edit a folder. nnn closes/toggles the current explorer

Explorer mode 2: https://asciinema.org/a/wAiGWbpjmutXfbx8mgKKlEwey I close nnn, I do a vsplit. Inside the vsplit I do a edit of a folder. This closes the vsplit and opens the explorer. I then try to open a file init.vim and it shows an error.

The error is:

Error executing vim.schedule lua callback: ...l/share/nvim/site/pack/packer/start/nnn.nvim/lua/nnn.lua:101: Invalid window id: 1002
stack traceback:
        [C]: in function 'nvim_set_current_win'
        ...l/share/nvim/site/pack/packer/start/nnn.nvim/lua/nnn.lua:101: in function 'handle_files'
        ...l/share/nvim/site/pack/packer/start/nnn.nvim/lua/nnn.lua:130: in function <...l/share/nvim/site/pack/packer/start/nnn.nvim/lua/nnn.lua:129>

I guess that the issue is that I have nnn replacing netrw. When using :e netrw would open on the new buffer and the selection after would replace netrw.

luukvbaal commented 2 years ago

Should be fixed in https://github.com/luukvbaal/nnn.nvim/commit/35c6e190086350e77fd6ae2644f91bcc2b61407a, please confirm.

FabioAntunes commented 2 years ago

I can confirm that it's working. You rock! thanks for all the hard work.