Fixed issue with TabBar (tabbar grouping was incorrectly switching theide to invalid file after clicking it in FileList)

git-svn-id: svn://ultimatepp.org/upp/trunk@10223 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2016-09-18 16:43:23 +00:00
parent 74bc5b4f27
commit da4f7e7ef5
3 changed files with 11 additions and 3 deletions

View file

@ -504,7 +504,7 @@ void TabBar::ContextMenu(Bar& bar)
for(int i = 0; i < cnt; i++)
{
String name = Format("%s (%d)", groups[i].name, groups[i].count);
Bar::Item &it = bar.Add(name, THISBACK1(DoGrouping, i));
Bar::Item &it = bar.Add(name, THISBACK1(GoGrouping, i));
if(i == group)
it.Image(TabBarImg::CHK);
if(i == 0 && cnt > 1)
@ -715,7 +715,7 @@ void TabBar::MakeGroups()
group--;
}
void TabBar::DoGrouping(int n)
void TabBar::GoGrouping(int n)
{
Value c = GetData();
group = n;
@ -729,6 +729,14 @@ void TabBar::DoGrouping(int n)
Refresh();
}
void TabBar::DoGrouping(int n)
{
group = n;
Repos();
SyncScrollBar();
}
void TabBar::DoCloseGroup(int n)
{
int cnt = groups.GetCount();

View file

@ -370,6 +370,7 @@ protected:
void MakeGroups();
int FindGroup(const String& g) const;
void CloseAll(int exception);
void GoGrouping(int n);
void DoGrouping(int n);
void DoCloseGroup(int n);
void NewGroup(const String& name);

View file

@ -70,7 +70,6 @@ void Ide::FileCursor()
String p = GetActiveFileName();
if(p != HELPNAME)
p = GetActiveFilePath();
EditFile0(p, f.charset ? f.charset : actual.charset ? actual.charset : default_charset,
false, headername);
}