Fix #1729: Status bar cursor updates without requiring a tab switch - #2188
Open
Borisserz wants to merge 1 commit into
Open
Fix #1729: Status bar cursor updates without requiring a tab switch#2188Borisserz wants to merge 1 commit into
Borisserz wants to merge 1 commit into
Conversation
Reuse the EditorInstance stored in tabs, avoid clearing caret on nil SourceEditor updates, and bind the status bar label by object identity so Line/Col appears without a tab switch.
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.
Description
Fixes the status bar Line/Col label staying empty (or stale) until the first editor tab switch after opening a workspace.
Root causes addressed:
Editor.openTabcould select a freshly allocatedEditorInstancewhiletabskept a different object for the same file (EditorInstanceequality is by file). The editor view and status bar then observed different publishers.CodeFileViewwrotenewState.cursorPositions ?? [], clearing the caret on scroll-only SourceEditor updates that omit cursor state.Also documents the behavior in DocC and adds unit + UI regression coverage.
Related Issues
Checklist
Screenshots
N/A for this logic fix (status bar text). UI regression covered in
ProjectNavigatorUITests.Test plan
StatusBarCursorPositionLabelTests(label formatting / unresolved fallback)EditorTabReuseTests(reopen reuses sameEditorInstance)--stricton touched files (0 violations)Made with Cursor