We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e22dac commit 5724c72Copy full SHA for 5724c72
1 file changed
CodeEdit/Features/Editor/Models/Editor.swift
@@ -195,7 +195,13 @@ final class Editor: ObservableObject, Identifiable {
195
if let index {
196
tabs.insert(item, at: index)
197
} else {
198
- tabs.append(item)
+ guard let currentTab = selectedTab, let currentIndex = tabs.firstIndex(of: currentTab)
199
+ else {
200
+ tabs.append(item)
201
+ return
202
+ }
203
+ let nextIndex = tabs.index(after: currentIndex)
204
+ tabs.insert(item, at: nextIndex)
205
}
206
selectedTab = item
207
if !fromHistory {
0 commit comments