From a3f72abbdeac2d251c4221f1cb42896587afd60b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 20 May 2022 21:30:49 -0700 Subject: reduce ambitions a bit: page up/down need not start screen from the middle of a line But we still have work to do for cursor up/down. --- text.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'text.lua') diff --git a/text.lua b/text.lua index 6aa2eba..c94d8ce 100644 --- a/text.lua +++ b/text.lua @@ -26,13 +26,6 @@ function Text.draw(line, line_width, line_index) y = y + math.floor(15*Zoom) if New_render then print('y', y) end end - if y > Screen_height then - if line.screen_line_starting_pos then - Bottom_screen_line_starting_pos = line.screen_line_starting_pos[#line.screen_line_starting_pos] - else - Bottom_screen_line_starting_pos = 1 - end - end x = 25 if line.screen_line_starting_pos == nil then line.screen_line_starting_pos = {1, pos} @@ -294,8 +287,11 @@ function Text.keychord_pressed(chord) end end if Cursor_line > Screen_bottom_line then + print('screen top before:', Screen_top_line, Top_screen_line_starting_pos) Screen_top_line = Cursor_line + print('scroll up preserving cursor') Text.scroll_up_while_cursor_on_screen() + print('screen top after:', Screen_top_line, Top_screen_line_starting_pos) end else -- move down one screen line in current line -- cgit 1.4.1-2-gfad0