nnn.vim icon indicating copy to clipboard operation
nnn.vim copied to clipboard

Error when exiting nnn picker without choosing a file.

Open Oxore opened this issue 10 months ago • 3 comments

Describe the bug

I get multiple Neovim errors when I exit nnn picker without choosing a file, i.e. by pressing q.

To Reproduce

Minimal configuration:

call plug#begin('~/.local/share/nvim/site/plugged')
Plug 'mcchrish/nnn.vim'
call plug#end()

Steps to reproduce:

  1. Open Neovim nvim -u testrc.vim testrc.vim.
  2. Run command :NnnPicker %:p:h. This is recommended way in the readme to make nnn start in the current file's directory.
  3. Press q on the opened nnn picker window.
  4. See error. You may want to press Enter a couple of times to see all errors.

After this the behavior is proper: Neovim shows previously opened file, no problem. Error messages are the problem basically.

The text of the error:

Error detected while processing function <SNR>45_callback:
line   11:
E684: list index out of range: 1
Press ENTER or type command to continue
Error detected while processing function <SNR>45_callback:
line   12:
E121: Undefined variable: lastd
Press ENTER or type command to continue
Error detected while processing function <SNR>45_callback:
line   12:
E116: Invalid arguments for function fnameescape
Press ENTER or type command to continue

Expected behavior

Close nnn picker window by q key hit without errors and show previously opened file.

Screenshots

2023-08-19_21:05:49_950x370 2023-08-19_21:05:52_950x370 2023-08-19_21:05:56_950x370

Environment:

  • OS: Gentoo 2.13, x86_64 Linux 6.1.38-gentoo
  • Terminal: st 0.9
  • Shell: zsh 5.9 (x86_64-pc-linux-gnu)
  • Vim version: NVIM v0.9.0
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/x86_64-pc-linux-gnu-gcc  -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include -I/tmp/portage/portage/app-editors/neovim-0.9.0-r1/work/neovim-0.9.0_build/src/nvim/auto -I/tmp/portage/portage/app-editors/neovim-0.9.0-r1/work/neovim-0.9.0_build/include -I/tmp/portage/portage/app-editors/neovim-0.9.0-r1/work/neovim-0.9.0_build/cmake.config -I/tmp/portage/portage/app-editors/neovim-0.9.0-r1/work/neovim-0.9.0/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include
  • Plugin manager: vim-plug
  • Plugin version: master e0104e369508fc12e3651ad4dee20261b5b3e87f
  • Nnn version: 4.8

Additional context

The %:p:h argument is actually not relevant. Starting :NnnPicker without arguments will lead to errors too when NNN closed by q. I found it after I already took screenshots and decided to leave "steps to reproduce" section as is.

Oxore avatar Aug 19 '23 19:08 Oxore