Fix bug where exit-to-editor may use wrong position in certain cases.

This could happen in certain situations where an error is detected at the end of a line (for example with "cannot redefine a macro" errors).

Fixes #40.
This commit is contained in:
Stephen Heumann 2018-09-06 23:55:25 -05:00
parent f70f03d473
commit d33ac61af3
1 changed files with 6 additions and 2 deletions

View File

@ -630,8 +630,12 @@ if list or (numErr <> 0) then begin
end; {case}
writeln(msg^);
if terminalErrors then begin
if enterEditor then
ExitToEditor(msg, ord4(firstPtr)+col-ord4(bofPtr)-1)
if enterEditor then begin
if line = lineNumber then
ExitToEditor(msg, ord4(firstPtr)+col-ord4(bofPtr)-1)
else
ExitToEditor(msg, ord4(firstPtr)-ord4(bofPtr)-1);
end {if}
else
TermError(0);
end; {if}