From d6220432848f3ad9e1276cc9ccfdba0b113adaf7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 19 May 2022 22:56:55 -0700 Subject: planning out cursor up/down over wrapped lines --- README.md | 6 +++--- text.lua | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 240b9a6..6325830 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Known issues: implications: * A long series of drawings will get silently skipped when you hit page-down, until a line of text can be showed on screen. - * If there's no line of text at the bottom of the file, one will be - created. - So far this app isn't really designed for all-drawing files. I'm really just + * If there's no line of text at the top of the file, you may not be able + to scroll back up to the top with page-up. + So far this app isn't really designed for drawing-heavy files. For now I'm targeting mostly-text files with a few drawings mixed in. diff --git a/text.lua b/text.lua index c14a60d..07931ea 100644 --- a/text.lua +++ b/text.lua @@ -213,6 +213,7 @@ function Text.keychord_pressed(chord) save_to_disk(Lines, Filename) elseif chord == 'up' then assert(Lines[Cursor_line].mode == 'text') + -- previous text line local new_cursor_line = Cursor_line while new_cursor_line > 1 do new_cursor_line = new_cursor_line-1 @@ -228,6 +229,7 @@ function Text.keychord_pressed(chord) end elseif chord == 'down' then assert(Lines[Cursor_line].mode == 'text') + -- next text line local new_cursor_line = Cursor_line while new_cursor_line < #Lines do new_cursor_line = new_cursor_line+1 -- cgit 1.4.1-2-gfad0