Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CodeEdit/Features/Editor/Models/EditorManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ class EditorManager: ObservableObject {
func switchToActiveEditor() {
cancellable?.cancel()
cancellable = nil

// Send the current value immediately so subscribers get the initial state
tabBarTabIdSubject.send(activeEditor.selectedTab)

cancellable = activeEditor.$selectedTab
.dropFirst() // Avoid duplicate emission since we just sent the current value
.sink { [weak self] tab in
self?.tabBarTabIdSubject.send(tab)
}
Expand Down