editor: abort in buildNRun if save fails

- also fix possible bug in gotoLine if
  file is empty
This commit is contained in:
slederer 2025-01-13 01:49:48 +01:00
parent 74a467cba6
commit 2f81ee73e1

View file

@ -137,7 +137,8 @@ end;
procedure getScreenSize;
var c:char;
begin
(* empty keyboard buffer *)
(* empty keyboard buffer to make sure GetTermSize
can read the response from the terminal *)
while conavail do read(con, c);
GetTermSize(screenW, screenH);
@ -1661,11 +1662,10 @@ end;
procedure gotoLine(l:integer);
begin
if l < 1 then
l := 1
else
if l > lineCount then
l := lineCount;
if l < 1 then
l := 1;
topY := l - (screenH div 2);
if topY < 1 then
@ -1713,7 +1713,7 @@ var error:integer;
begin
success := true;
if isModified then
save;
writeFile(success);
if success then
begin
if isAsmFile(filename) then