declancm/windex.nvim

Error occured while using shade.nvim

Closed this issue · 2 comments

Maybe conflict between windex and shade.nvim

E5108: Error executing lua ...site/pack/packer/opt/windex.nvim/lua/windex/maximize.lua:73: Vim(call):E5108: Error executing lua ...share/nvim/site/pack/packer/opt/shade.nvim/
lua/shade.lua:326: Invalid window id: 1002
stack traceback:
        [C]: in function 'nvim_win_close'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:326: in function 'on_win_closed'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:439: in function 'fn'
        ...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:456: in function <...share/nvim/site/pack/packer/opt/shade.nvim/lua/shade.lua:428>
        [C]: in function 'cmd'
        ...site/pack/packer/opt/windex.nvim/lua/windex/maximize.lua:73: in function 'maximize'
        ...site/pack/packer/opt/windex.nvim/lua/windex/maximize.lua:24: in function 'toggle'
        ...vim/site/pack/packer/opt/windex.nvim/lua/windex/init.lua:201: in function 'toggle_nvim_maximize'
        [string ":lua"]:1: in main chunk
stack traceback:
        [C]: in function 'cmd'
        ...site/pack/packer/opt/windex.nvim/lua/windex/maximize.lua:73: in function 'maximize'
        ...site/pack/packer/opt/windex.nvim/lua/windex/maximize.lua:24: in function 'toggle'
        ...vim/site/pack/packer/opt/windex.nvim/lua/windex/init.lua:201: in function 'toggle_nvim_maximize'
        [string ":lua"]:1: in main chunk

Hi! You're definitely right about Shade, I think it creates issues when creating and sourcing session files which is what the maximizing feature uses. You can bypass this by disabling shade during the maximizing :). Can you please let me know if this works for you too

require('windex').setup {
  default_keymaps = false,
}

vim.keymap.set('n', '<Leader>z', function()
  require('shade').toggle()
  require('windex').toggle_maximize()
  require('shade').toggle()
end)

yes, it works, thank you very much