Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
antoinegomez opened this issue Feb 24, 2024 · 0 comments · May be fixed by #1398
Open

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

antoinegomez opened this issue Feb 24, 2024 · 0 comments · May be fixed by #1398

Comments

@antoinegomez
Copy link

antoinegomez commented Feb 24, 2024

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>
scratchyone added a commit to scratchyone/lspsaga.nvim that referenced this issue Feb 24, 2024
scratchyone added a commit to scratchyone/lspsaga.nvim that referenced this issue Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant