Fix the source line having the entire file

This commit is contained in:
smallmodel 2024-11-01 00:11:09 +01:00
parent 6ff92f0a7e
commit 32c3964474
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -89,7 +89,9 @@ bool AbstractScript::GetSourceAt(size_t sourcePos, str *sourceLine, int& column,
if (*p == '\n') {
line++;
column = 0;
posLine = i + 1;
if (i + 1 != sourcePos) {
posLine = i + 1;
}
} else if (*p == '\0') {
break;
}