Skip to content

Commit

Permalink
When there is only one tab in an editor and the navigation style chan…
Browse files Browse the repository at this point in the history
…ges to open in place, we change the tab to be termporary so that tab bar will hide
  • Loading branch information
austincondiff committed Mar 6, 2024
1 parent 1d9f98e commit f4f257a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CodeEdit/Features/Editor/Views/EditorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ struct EditorView: View {
editor.temporaryTab = nil
}
}
.onChange(of: editorManager.flattenedEditors) { newValue in
print(newValue)
.onChange(of: navigationStyle) { newValue in
if newValue == .openInPlace && editor.tabs.count == 1 {
editor.temporaryTab = editor.tabs[0]
}
}
}
}

0 comments on commit f4f257a

Please sign in to comment.