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

ts.swap_nodes throws error on latest Neovim master #54

Closed
NoahTheDuke opened this issue Feb 27, 2024 · 3 comments · Fixed by #55
Closed

ts.swap_nodes throws error on latest Neovim master #54

NoahTheDuke opened this issue Feb 27, 2024 · 3 comments · Fixed by #55

Comments

@NoahTheDuke
Copy link
Contributor

I run neovim master, and have run into an issue with all of the functions that use ts.swap_nodes. Since neovim/neovim#27614, neovim now requires that the buffer number passed to apply_text_edits (which ts.swap_nodes uses) is non-nil and non-0. Every call to ts.swap_nodes in nvim-paredit that I saw uses 0 to specify "the current buffer". The fix should be as easy as passing vim.api.nvim_get_current_buf() to all of the ts.swap_nodes calls in place of 0.

@NoahTheDuke
Copy link
Contributor Author

NoahTheDuke commented Feb 27, 2024

I implemented such a change locally and the tests pass with 0.9.5 but fail for other reasons with 0.10 (master). I'm not entirely sure what else has changed, but I can open a PR if you want just this fix.

EDIT: I went ahead with opening the PR.

@julienvincent
Copy link
Owner

Yea the tests for neovim nightly have been failing here for a while. I haven't had a proper chance to investigate it. Those tests are currently disabled for the CI tests that run here.

Thanks for the fix!

@NoahTheDuke
Copy link
Contributor Author

Glad to help.

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.

2 participants