s1n7ax / nvim-window-picker

This plugins prompts the user to pick a window and returns the window id of the picked window
MIT License
315 stars 25 forks source link

statusline-winbar-hint doesn't play well when cmdheight > 1 #81

Open Frederick888 opened 6 months ago

Frederick888 commented 6 months ago

I'm using cmdheight = 2 and laststatus = 3

It seems due to https://github.com/s1n7ax/nvim-window-picker/blob/41cfaa428577c53552200a404ae9b3a0b5719706/lua/window-picker/hints/statusline-winbar-hint.lua#L30-L33, when window picker is in action, cmdheight gets reduced to 1 temporarily, which makes it a bit 'jumpy'.

I can see the opt_save part so this seems intentional(?). But I wonder if it's possible to make it a bit adaptive? Thank you!

EricDriussi commented 1 month ago

Possibly related: there seems to be an issue when using both this plugin and noice.nvim.

Following this plugin (plus neo-tree in my case) install/config instructions as well as noice.nvim instructions, trying to select a window with this plugin results in an error:

E5108: Error executing lua: ...icker/lua/window-picker/hints/statusline-winbar-hint.lua:148: Invalid window id: 1004
stack traceback:
    [C]: in function '__newindex'
    ...icker/lua/window-picker/hints/statusline-winbar-hint.lua:148: in function 'restore_win_opts'
    ...icker/lua/window-picker/hints/statusline-winbar-hint.lua:109: in function 'clear'
    ...indow-picker/lua/window-picker/pickers/window-picker.lua:75: in function 'pick_window'
    ...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:854: in function 'open_file'
    ...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:731: in function 'open'
    ...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:755: in function 'open_with_cmd'
    ...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:875: in function 'split_with_window_picker'
    ...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:212: in function <...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:211>