Skip to content

Commit

Permalink
Update temporaryTab in closeTab
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoolwinter committed Jun 30, 2023
1 parent 2326284 commit 6ffee4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CodeEdit/Features/Tabs/TabGroup/TabGroupData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ final class TabGroupData: ObservableObject, Identifiable {
/// This will also write any changes to the file on disk and will add the tab to the tab history.
/// - Parameter item: the tab to close.
func closeTab(item: Tab) {
if temporaryTab == item {
temporaryTab = nil
}

historyOffset = 0
if item != selected {
history.prepend(item)
Expand Down Expand Up @@ -200,7 +204,6 @@ final class TabGroupData: ObservableObject, Identifiable {
)
item.fileDocument = codeFile
CodeEditDocumentController.shared.addDocument(codeFile)
print("Opening file for item: ", item.url)
}

func goBackInHistory() {
Expand Down

0 comments on commit 6ffee4e

Please sign in to comment.