-
-
Notifications
You must be signed in to change notification settings - Fork 483
Fix E1312 when quitting a window #875
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
Open
yousong
wants to merge
2
commits into
preservim:master
Choose a base branch
from
yousong:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why different wait time argument for the 3 timer_start call? I think maybe what matters is where the command is going to be invoked, and the wait time can be all 0.
Uh oh!
There was an error while loading. Please reload this page.
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.
The
call timer_start()will return immediately after the call is queued. But there can be different background threads that will actually execute the queued call. So the delay is in there to allow for the previously queued call time to execute and complete before starting the next one. It is kind of a soft serialization of the queued calls so they aren't trying to all execute at the same time.What we want to avoid
The
parsection will execute in parallel, and we don't have control over the order in which the threads execute.sequenceDiagram participant main create participant only_window as s:HandleOnlyWindow() main->>only_window: call create participant close as timer_start(0) only_window-->>close: call timer_start(0) create participant bdelete as timer_start(0) only_window-->>bdelete: call timer_start(0) create participant quit as timer_start(0) only_window-->>quit: call timer_start(0) destroy only_window only_window->>main: return par note over bdelete: execute('noautocmd keepalt bdelete ' . tagbarwinnr) and note over close: s:CloseWindow() and note over quit: execute('q', 'silent!') end destroy close close->>main: done destroy bdelete bdelete->>main: done destroy quit quit->>main: doneAdding delay in timer
In this instance, we add the delays to ensure there is time for the other tasks to complete in proper order.
sequenceDiagram participant main create participant only_window as s:HandleOnlyWindow() main->>only_window: call create participant close as timer_start(10) only_window-->>close: call timer_start(10) create participant bdelete as timer_start(20) only_window-->>bdelete: call timer_start(20) create participant quit as timer_start(50) only_window-->>quit: call timer_start(50) destroy only_window only_window->>main: return note over close: s:CloseWindow() destroy close close->>main: done note over bdelete: execute('noautocmd keepalt bdelete ' . tagbarwinnr) destroy bdelete bdelete->>main: done note over quit: execute('q', 'silent!') destroy quit quit->>main: done