diff --git a/progs/editor.pas b/progs/editor.pas index 070aaed..d6ec563 100644 --- a/progs/editor.pas +++ b/progs/editor.pas @@ -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