mcchrish / nnn.vim

File manager for vim/neovim powered by n³
BSD 2-Clause "Simplified" License
646 stars 25 forks source link

NnnPicker file select not working inside splits #35

Closed michaelmob closed 5 years ago

michaelmob commented 5 years ago

Describe the bug

Selecting a file from :NnnPicker inside of a split throws an error and then closes the split.

To Reproduce

  1. Open vim
  2. Run command :sp
  3. Navigate to new split (<C-w>j)
  4. Run :NnnPicker (in new split)
  5. In NnnPicker, press enter on file I want to edit
  6. Pressing enter on the error message closes the split
Error detected while processing function <SNR>26_callback[7]..<SNR>26_eval_temp:
line   23:
E16: Invalid range: 2wincmd w
Press ENTER or type command to continue

Expected behavior

File should open in the split.

Screenshots

If applicable, add screenshots/gifs/videos to help explain your problem.

Environment:

Additional context

I am looking to use NnnPicker as a split explorer rather than a project drawer, if that makes a difference. The idea is explained here.

mcchrish commented 5 years ago

@thetarkus thanks for the bug report and suggestion. I actually like the concept and looks like the plugin is buggy with the use case. Just updated.

Also added a new behavior when nothing was selected when closing nnn, it switches backs to the last buffer of that window.