Repository navigation
Re-index tab numbers when a tab closes via its last pane exiting - #8
Merged
Merged
Conversation
Herdr only emits tab.closed for explicit tab closes. When a tab dies because its last shell exits, Herdr reports pane.exited instead, so the plugin never re-synchronised and later tabs kept stale position numbers. Subscribe to pane.closed and pane.exited and treat both as workspace re-sync events, mirroring tab.closed and tab.moved.
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.
Problem
Tab numbers were not re-indexed after closing tabs. The plugin code was correct, but Herdr only emits
tab.closedfor explicit tab closes (herdr tab close, close-tab keybind). When a tab dies because its last pane's shell exits (typingexit, a process ending), Herdr emitspane.exitedinstead — which the plugin never subscribed to, so later tabs kept stale position numbers.Reproduced live: killing a middle tab via shell exit left
zeta · 5sitting at display position 4 with no plugin invocation logged.Fix
pane.closedandpane.exitedinherdr-plugin.tomlTabNumbersPlugin, mirroringtab.closed/tab.movedBoth hooks are idempotent and cheap (
0 changedwhen nothing moved), so pane closes that do not remove a tab are harmless no-ops.Verification
pane.exitedfired andomega · 4correctly becameomega · 3herdr tab closepath still re-indexes viatab.closedvp test plugins/tab-numbers)