-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
fix: replace deprecated table operations for neovim v0.10 #489
Conversation
Just tested this on my machine, works well! |
Can you try with the command |
|
I am using Neogit, that uses diffview.nvim. I have the same problem on markdowns (.md) files only. Other diffs are OK (.json, etc) |
@mikesmithgh I meet the same issue, with the following error:
|
diffview-issue.webm |
@serranomorante @LinoWhy @ctretyak thank you for pointing this out. TL;DR;
My branch accidentally reverted to main that is why I did not see the error. So, that is one thing to point out. It seems like the latest nightly nvim may no longer be crashing due to the deprecated usage. So, you may not need to point to this branch unless you would like to test this functionality. The issue appeared to be related to flatten. vim.iter({ 1, { 2 }, { { 3 } } }):flatten():totable()
-- result: { 1, 2, { 3 } }
vs
vim.iter({ 1, { 2 }, { { 3 } } }):flatten(math.huge):totable()
-- result: { 1, 2, 3 }
|
Upstream has some issues with the latest release of NeoVim: - sindrets/diffview.nvim#492 - sindrets/diffview.nvim#489
Unlike the `iter(...):flatten()` alternative, this handles lists with holes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I made a small change where I opted to use the old implementation of tbl_flatten()
from Neovim because unlike the iter(...):flatten()
alternative, it handles lists with holes.
Awesome! 😎 |
Resolves #488.
Neovim nightly deprecated some table operations resulting in diffview.nvim crashes. I've moved the operations
islist
andflatten
to the utils package so that we can apply the appropriate function depending on the Neovim version.Please let me know what you think, thanks!