Skip to content

Commit ce5df54

Browse files
fix: Status bar cursor position updates when workspace is first opened
The cursor position label in the status bar was not updating until the first tab switch because it only subscribed to tabBarTabIdSubject (which fires on tab changes) and onAppear (which may fire before a tab is selected during workspace restoration). Added an additional observer on editorManager.$activeEditor so the label updates whenever the active editor changes, including on initial workspace open. Fixes #1729
1 parent 74d1c3b commit ce5df54

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarCursorPositionLabel.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ struct StatusBarCursorPositionLabel: View {
3838
.onReceive(editorManager.tabBarTabIdSubject) { _ in
3939
updateSource()
4040
}
41+
.onReceive(editorManager.$activeEditor) { _ in
42+
updateSource()
43+
}
4144
}
4245

4346
struct LineLabel: View {

0 commit comments

Comments
 (0)