Skip to content

Fix job race condition and guard exit callbacks - #265

Open
aphroteus wants to merge 1 commit into
mhinz:masterfrom
aphroteus:master
Open

Fix job race condition and guard exit callbacks#265
aphroteus wants to merge 1 commit into
mhinz:masterfrom
aphroteus:master

Conversation

@aphroteus

Copy link
Copy Markdown

When initiating a new search while a previous job is running, stdout and exit callbacks from superseded jobs continue to execute because 's:id' is overwritten, polluting the quickfix list.

Additionally, if tabs or windows are closed during an async search, restoring focus using static window numbers throws errors or focuses the wrong window.

  • Assign a monotonic job_id to each task and discard callbacks from superseded jobs
  • Use win_gotoid() for precise window/tab restoration with bounds-checked fallback

When initiating a new search while a previous job is running, stdout and exit
callbacks from superseded jobs continue to execute because 's:id' is
overwritten, polluting the quickfix list.

Additionally, if tabs or windows are closed during an async search, restoring
focus using static window numbers throws errors or focuses the wrong window.

- Assign a monotonic job_id to each task and discard callbacks from superseded jobs
- Use win_gotoid() for precise window/tab restoration with bounds-checked fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant