lspsaga.nvim
lspsaga.nvim copied to clipboard
fix: handle breaking change to vim.api.nvim_win_get_config (#1397)
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 .
there has util is_ten as condtion i do some check in layout you can check it.
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.
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.