ide: Context goto in .log now tries to detect source file path first (handles ASSERT log line)

This commit is contained in:
Mirek Fidler 2026-02-08 19:53:29 +01:00
parent 5f44455bc2
commit 2aae7eee05
2 changed files with 30 additions and 3 deletions

View file

@ -168,7 +168,9 @@ void CopyGitRevisions(const DropList& dl)
s.TrimStart("\1");
MergeWith(qtf, "&", s);
}
AppendClipboard(ParseQTF(qtf));
RichText txt = ParseQTF(qtf);
ClearClipboard();
AppendClipboard(pick(txt));
}
void LoadGitRevisions(DropList& r, const String& dir, const String& branch, const String& file)

View file

@ -63,6 +63,33 @@ bool Ide::FindLOG()
if(!IsInLogFile())
return false;
String ln = editor.GetUtf8Line(editor.GetCursorLine());
for(const char *s = ln; *s;) { // try to find source file path first
if(*s == ' ' || *s == '\t') {
while(*s == ' ' || *s == '\t') s++;
if(*s)
for(const char *q = s + 1; *q; q++) {
String path = String(s, q);
if(FileExists(path)) {
while(*q) {
if(IsDigit(*q)) {
AddHistory();
EditFile(path);
editor.SetCursor(editor.GetPos(Atoi(q) - 1, 0));
AddHistory();
return true;
}
q++;
}
break;
}
}
}
else
s++;
}
Vector<String> files = FindXFiles(3);
int n = 0;
@ -152,8 +179,6 @@ bool Ide::FindLOG()
}
}
String ln = editor.GetUtf8Line(editor.GetCursorLine());
LogLine bestl;
int best = -1;
int bestp = false;