lspsaga.nvim icon indicating copy to clipboard operation
lspsaga.nvim copied to clipboard

nvim_win_get_config() returns numbers for col and row and not table

Open antoinegomez opened this issue 1 year ago • 0 comments

Hello,

In codeaction/preview.lua

local function create_preview_win(content, main_winid)
  local win_conf = api.nvim_win_get_config(main_winid)

Is not returning a table with [true] and [false] for row and col and this making this function crash.

nvim --version
NVIM v0.10.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

I use quite a lot of plugins (woops) but here is where I reproduced it:

  • lspconfig
  • typescript-tools
  • none-ls -> code action builtin eslint
  • cssmodules_ls
  • tailwindcss

This happens on [1] Move to a new file action

I temporary fixed this issue by detecting that row/col are not a table and then reassign it but it might not be the right way to do, just stopping the error without refactoring to much code.

Not sure where the problem lies. I will try to reproduce with a lighter config and share it.

Error detected while processing CursorMoved Autocommands for "<buffer=4>":
Error executing lua callback: ...er/start/lspsaga.nvim/lua/lspsaga/codeaction/preview.lua:104: attempt to index field 'col' (a number value)
stack traceback:
        ...er/start/lspsaga.nvim/lua/lspsaga/codeaction/preview.lua:104: in function 'create_preview_win'
        ...er/start/lspsaga.nvim/lua/lspsaga/codeaction/preview.lua:158: in function 'action_preview'
        ...acker/start/lspsaga.nvim/lua/lspsaga/codeaction/init.lua:239: in function 'set_cursor'
        ...acker/start/lspsaga.nvim/lua/lspsaga/codeaction/init.lua:99: in function <...acker/start/lspsaga.nvim/lua/lspsaga/codeaction/init.lua:98>

antoinegomez avatar Feb 24 '24 22:02 antoinegomez