fix: Status bar cursor position not updating on workspace open#2167
Open
William-Laverty wants to merge 2 commits intoCodeEditApp:mainfrom
Open
fix: Status bar cursor position not updating on workspace open#2167William-Laverty wants to merge 2 commits intoCodeEditApp:mainfrom
William-Laverty wants to merge 2 commits intoCodeEditApp:mainfrom
Conversation
ce5df54 to
d2a9dbe
Compare
Reads the autocompleteBraces setting via @appsettings and passes it to the SourceEditorConfiguration's behavior, enabling the setting to actually control whether brackets are auto-completed in the editor. Requires corresponding change in CodeEditSourceEditor. Fixes CodeEditApp#1691
The status bar cursor position label relied solely on tabBarTabIdSubject (a PassthroughSubject) and onAppear to get the current tab. When a workspace was first opened, the selected tab was set during state restoration before the status bar view subscribed to the subject, causing it to miss the initial value. This adds an additional onReceive subscriber to the active editor's $selectedTab publisher, which is a @published property and replays its current value on subscription, ensuring the status bar updates immediately. Fixes CodeEditApp#1729
d2a9dbe to
f2c3278
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.
Summary
Fixes the status bar cursor position label not displaying line/column information until the first tab switch after opening a workspace.
Problem
The
StatusBarCursorPositionLabelonly subscribed totabBarTabIdSubject(fired on tab changes) and usedonAppear(which often fires before the workspace has restored its active tab). This meant the label stayed empty until the user manually switched tabs.Fix
Added an additional
.onReceive(editorManager.$activeEditor)observer so the cursor position label updates whenever the active editor changes, including during initial workspace restoration.Changes
StatusBarCursorPositionLabel.swift: Subscribe toeditorManager.$activeEditorpublisherFixes #1729