-
-
Notifications
You must be signed in to change notification settings - Fork 17
fix: defer closing guest to make rpcrequest work #102
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ function M.maybe_block(block) | |
end | ||
vim.fn.chanclose(host) | ||
while true do | ||
vim.cmd.sleep(1) | ||
vim.cmd.sleep(10) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think maybe this should just be changed to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a big problem with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm I'm not sure this is the case - vim.wait is blocking (for Lua), it just may not fully block the event loop - I don't think the guest is responsive while blocked. It definitely isn't for me, main is using vim.wait now and it works for me :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is blocking the function where it is called but it is not blocking the UI. Try this:
That's why I believe it is better to use |
||
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.
Have you tried this with just
vim.schedule
? I'd like to avoid timers here if possible.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.
I don't remember why I've used
defer_fn
instead ofschedule
butschedule
seems to work as well.