ide: Alt-J in .log improved

This commit is contained in:
Mirek Fidler 2026-01-21 12:11:41 +01:00
parent 71ead17f76
commit ffa3f32cd6

View file

@ -157,11 +157,14 @@ bool Ide::FindLOG()
LogLine bestl;
int best = -1;
int bestp = false;
int bestr = INT_MIN;
for(const LogLine& l : logs) {
int ml = GetMatchLen(l.text, ln);
if(ml > best || ml == best && l.priority > bestp) {
int rest = ml - l.text.GetCount();
if(CombineCompare(ml, best)(rest, bestr)(l.priority, bestp) > 0) {
best = ml;
bestp = l.priority;
bestr = rest;
bestl = l;
}
}