mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
refactor: select the previous tab while closing the actived one (#621)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
b175ab3a3e
commit
4a6cbddeac
1 changed files with 1 additions and 6 deletions
|
@ -204,12 +204,7 @@ namespace SourceGit.ViewModels
|
||||||
var activeIdx = Pages.IndexOf(_activePage);
|
var activeIdx = Pages.IndexOf(_activePage);
|
||||||
if (removeIdx == activeIdx)
|
if (removeIdx == activeIdx)
|
||||||
{
|
{
|
||||||
ActivePage = Pages[removeIdx == Pages.Count - 1 ? removeIdx - 1 : removeIdx + 1];
|
ActivePage = Pages[removeIdx > 0 ? removeIdx - 1 : removeIdx + 1];
|
||||||
CloseRepositoryInTab(page);
|
|
||||||
Pages.RemoveAt(removeIdx);
|
|
||||||
}
|
|
||||||
else if (removeIdx + 1 == activeIdx)
|
|
||||||
{
|
|
||||||
CloseRepositoryInTab(page);
|
CloseRepositoryInTab(page);
|
||||||
Pages.RemoveAt(removeIdx);
|
Pages.RemoveAt(removeIdx);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue