Skip to content

Commit

Permalink
fix: Changed alt screen rendering behaviour to avoid extra cleaned li…
Browse files Browse the repository at this point in the history
…nes (#23)

closes #6 

Co-authored-by: jmcavanillas <[email protected]>
  • Loading branch information
jmcavanillas and jmcavanillas authored Dec 31, 2023
1 parent d246edd commit 4f9938c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions minttea/renderer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 61,13 @@ and flush t =

(* clean last rendered lines *)
if t.lines_rendered > 0 then
for _i = 1 to t.lines_rendered do
for _i = 1 to t.lines_rendered - 1 do
Terminal.clear_line ();
Terminal.cursor_up 1;
Terminal.clear_line ()
done;

(* reset screen if its on alt *)
Format.printf "%s\r\n%!" t.buffer;
Format.printf "%s%!" t.buffer;

if t.is_altscreen_active then Terminal.move_cursor new_lines_this_flush 0
else Terminal.cursor_back t.width;
Expand Down

0 comments on commit 4f9938c

Please sign in to comment.