nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.41k stars 287 forks source link

fix: handle breaking change to vim.api.nvim_win_get_config (#1397) #1398

Open scratchyone opened 6 months ago

scratchyone commented 6 months ago

This PR fixes #1397, and adds support for the NVIM v0.10.0 nvim_win_get_config() API change.

It prioritizes the new API by making it the default and turning the return values into the v0.10.0 format if the user is running an older version of NVIM.

I've tested this locally and it fixes all the issues with code actions for me on NVIM v0.10.0-dev-2393+g93c911e52-Homebrew .

glepnir commented 6 months ago

there has util is_ten as condtion i do some check in layout you can check it.

scratchyone commented 6 months ago

there has util is_ten as condtion i do some check in layout you can check it.

I noticed that helper function while I was reviewing the rest of the codebase for any other possible v0.10.0-related bugs. However, I was worried about future-proofness because it appears to only check the minor version. That approach might not work properly if/when NVIM goes to version 1.0, which is why I decided to check the data-type instead. However, if you'd rather me update the commit to use the is_ten function I'd be happy to do that.

glepnir commented 6 months ago

in nightly the return type lua convert is fixed so when 0.10 released i decide remove support for 0.9* so we can just use nvim_win_get_config().col/row directly.