-
-
Notifications
You must be signed in to change notification settings - Fork 635
perf(#3171): use vim.system() instead of vim.fn.system() to execute git toplevel #3175
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
perf(#3171): use vim.system() instead of vim.fn.system() to execute git toplevel #3175
Conversation
This PR does not resolve #3171 - it only prevents cursor flickering in the case described there. Please notice unchanged win32 part - I cannot test it. |
Pure Nvim example: local timer = assert(vim.uv.new_timer())
timer:start(0, 600, function ()
vim.schedule(function ()
vim.fn.system({'true'})
end)
end) |
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.
It looks like vim.system was added in 2023: https://github.com/neovim/neovim/blob/c0952e62fd0/runtime/lua/vim/_editor.lua
Unfortunately it's not present in neovim v0.9.x, hence we'll need to add backwards compatibility shims. See example:
nvim-tree.lua/lua/nvim-tree.lua
Line 21 in a9156c0
if vim.fn.has("nvim-0.10") == 1 then |
Alternatively, I'm open to bumping the minimum neovim version to 0.11. Do you reckon it's time @gegoune ? We'd be at n-1 released nvim released version. It would involve:
That would be best done in a separate PR first. |
I think that should be OK, as vim's abstraction layer should handle it. Can you confirm that |
|
0.11 is current stable We moved to minimum version 0.9 on 2024-06-09 |
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.
Works on both codepaths, many thanks for the fix @przepompownia
n-1 should be enough in cases where it makes it easier to maintain the code. If no breaking changes happened along the way we can extend it a bit, but more as a happy accident rather than our policy. |
Cool, I guess we should document n-1 at the same time. |
No description provided.