ide: Fixed navigator sorting

This commit is contained in:
Mirek Fidler 2023-03-24 19:06:55 +01:00
parent 4a140cac04
commit 88def97efa

View file

@ -341,7 +341,7 @@ void Navigator::Search()
m.pos.x = 0;
}
else
if(IsNull(s) && !sorting) {
if(IsNull(s)) {
Ide *theide = TheIde();
if(theide)
for(const AnnotationItem& m : theide->editor.annotations) {
@ -396,6 +396,7 @@ void Navigator::Search()
m.id = SourcePath(wspc[i], p[j]);
m.pos = Point(0, 0);
m.nest = "<files>";
m.uname = ToUpper(p[j]);
nests.FindAdd(m.nest);
}
}
@ -415,6 +416,11 @@ void Navigator::Search()
litem.Add(&n);
}
if(sorting)
StableSort(litem, [=](const NavItem *a, const NavItem *b) {
return a->uname < b->uname;
});
int lsc = list.GetScroll();
list.Clear();
list.SetVirtualCount(litem.GetCount());