Open
Conversation
1c9fc33 to
6d41609
Compare
6d41609 to
492877e
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes several independent race conditions and correctness issues in the window close / app quit path. All changes are in VimR/VimR/ with no dependencies on other in-flight work.
AppDelegate.swift — applicationShouldTerminate
Both cancel paths (blocked-windows alert dismiss and dirty-windows cancel) returned without calling reply(toApplicationShouldTerminate:). Since the function returns .terminateLater, this left the app permanently stuck in a pending-termination state — subsequent window closes or Cmd+Q would misbehave because macOS considered termination already in progress. Added reply(false) before each early return.
MainWindow+Actions.swift / MainWindow+Delegates.swift / MainWindow.swift — dead closeWindow flag
The closeWindow IBAction set a closeWindow = true flag before calling performClose, causing windowShouldClose to send :qa! (quit all tabs) instead of :q (close current tab). Cmd+W should only close the current tab. Removed the flag, the defer reset, and the entire :qa! branch. windowShouldClose now always takes the closeCurrentTab / :q path.
MainWindow+Delegates.swift — ipcBecameInvalid
Called windowController.close() directly, bypassing neoVimStopped() / prepareClosing(). This meant isClosing was never set, the CLI pipe was not closed, and the Redux .close action was never emitted — leaving the window's UUID permanently in app state. Routed through neoVimStopped() instead.
UiRoot.swift — subscriber early-return race
The guard if self.mainWindows.isEmpty { return } was intended for app startup but also fired when a rapid second state update arrived after the last window had already been removed — silently preventing afterLastWindowAction (quit/hide) from ever firing. Restructured to only trigger quit/hide when windows were actually removed in this update and the result is empty (guard !uuidsToRemove.isEmpty, self.mainWindows.isEmpty).