Skip to content

Commit 4a6cbdd

Browse files
committed
refactor: select the previous tab while closing the actived one (#621)
Signed-off-by: leo <[email protected]>
1 parent b175ab3 commit 4a6cbdd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/ViewModels/Launcher.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,7 @@ public void CloseTab(LauncherPage page)
204204
var activeIdx = Pages.IndexOf(_activePage);
205205
if (removeIdx == activeIdx)
206206
{
207-
ActivePage = Pages[removeIdx == Pages.Count - 1 ? removeIdx - 1 : removeIdx + 1];
208-
CloseRepositoryInTab(page);
209-
Pages.RemoveAt(removeIdx);
210-
}
211-
else if (removeIdx + 1 == activeIdx)
212-
{
207+
ActivePage = Pages[removeIdx > 0 ? removeIdx - 1 : removeIdx + 1];
213208
CloseRepositoryInTab(page);
214209
Pages.RemoveAt(removeIdx);
215210
}

0 commit comments

Comments
 (0)