editor: abort in buildNRun if save fails
- also fix possible bug in gotoLine if file is empty
This commit is contained in:
parent
74a467cba6
commit
2f81ee73e1
1 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue