Closed
Description
Description
I get this error when I try to open a file under certain conditions:
Error executing vim.schedule lua callback: ...g/nvim-tree.lua/lua/nvim-tree/actions/node/open-file.lua:172: Invalid window id: 1008
stack traceback:
[C]: in function 'nvim_set_option_value'
...g/nvim-tree.lua/lua/nvim-tree/actions/node/open-file.lua:172: in function 'pick_win_id'
...g/nvim-tree.lua/lua/nvim-tree/actions/node/open-file.lua:249: in function 'get_target_winid'
...g/nvim-tree.lua/lua/nvim-tree/actions/node/open-file.lua:277: in function 'open_in_new_window'
...g/nvim-tree.lua/lua/nvim-tree/actions/node/open-file.lua:400: in function 'fn'
/tmp/plugged/vim-plug/nvim-tree.lua/lua/nvim-tree/view.lua:532: in function </tmp/plugged/vim-plug/nvim-tree.lua/lua/nvim-tree/view.lua:501>
I'm unsure if nvim-tree is really the root problem. I had to play around a lot to find the minmal set of plugins to reproduce the issue:
- vim-airline
- nvim-tre
- fzf-lua
- incline.nvim
Neovim version
NVIM v0.10.0
Build type: RelWithDebInfo
LuaJIT 2.1.1713484068
Operating system and version
Linux Mint 21.3
Windows variant
No response
nvim-tree version
Clean room replication
"
" Minimal vim config to reproduce issues without messing with installed plugins.
" Based on https://github.com/hrsh7th/nvim-cmp/blob/main/utils/vimrc.vim
"
" To start vim with this config:
" vim -u /path/to/minimal-example.vim
"
if has('vim_starting')
set encoding=utf-8
endif
scriptencoding utf-8
if &compatible
set nocompatible
endif
let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end
execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'nvim-tree/nvim-tree.lua'
Plug 'ibhagwan/fzf-lua', { 'branch': 'main' }
Plug 'b0o/incline.nvim'
call plug#end()
PlugInstall | quit
let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
set laststatus=3 " always show the status line
lua << EOF
require('fzf-lua').setup()
require('incline').setup()
require('nvim-tree').setup()
EOF
let mapleader = ',' " Map <leader> to , instead of default \
nmap <leader>t <Cmd>NvimTreeFindFileToggle<CR>
nmap <leader>/ <Cmd>FzfLua live_grep path_shorten=false<CR>
Steps to reproduce
mkdir test && cd test
touch {a,b,c}.txt
echo aaa > a.txt && echo aaa > c.txt
nvim -u /path/to/above/minimal.vim -o a.txt b.txt
- Press
,
+t
(to open nvim-tree)
You should now have this condition. Active window must be tree:
-
Pick file
c.txt
with<c-j>
followed by<CR>
-
Press
A
to select upper window.
Expected behavior
There should be no error