-
Notifications
You must be signed in to change notification settings - Fork 256
fix(git): make mark_ignored
async
#621
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
Conversation
Just realized that some tests are failing, not sure what's causing this 🤔 |
@cseickel Sorry for bugging you again, but any idea why this is happening? |
This adds an arbitrary delay after sending the keys in order to wait for the tree to be fully expanded
Codecov Report
@@ Coverage Diff @@
## main #621 +/- ##
==========================================
+ Coverage 50.45% 50.50% +0.05%
==========================================
Files 47 47
Lines 6099 6187 +88
==========================================
+ Hits 3077 3125 +48
- Misses 3022 3062 +40
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Alright, I figured out what's happening, it is some kind of race condition. neo-tree.nvim/tests/utils/init.lua Line 94 in 7c6903b
But once I figured that out, the cause is obvious: there's a bit of a delay between sending the keys, and the folder tree actually expanding when git_status_async is true . I'm still not sure about the real culprit causing that delay, but putting in an vim.wait after sending the keys seem to fix the issue.
|
That seems perfectly reasonable, if git status is async and the testing code is not, you would certainly expect the testing code to execute first. I think this PR looks good, but I want to take the time to really read it carefully before merging and I haven't gotten that time yet. I'll do that tonight or this weekend. |
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.
Looks good, I just have one nit-pick comment.
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.
This is good to go. Thanks!
This PR introduces an alternative async interface for
git.mark_ignored
. By providing a callback to the function, it will run the git operations vialuv.spawn
instead ofvim.fn.systemlist
.In the async interface, the files to be checked are fed through the stdin, instead of through the CLI arguments. This is because certain collection of filenames causes
luv
to fail to spawn the git process (maybe because of the length or certain unicode characters?). If there are any performance issues caused by the pipe method, I'll try to investigate further on it.