diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-06-05 10:08:28 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-06-05 10:08:28 -0700 |
commit | 9cafed99f4afbe1b8e7d20d78f623b9ee32579ef (patch) | |
tree | 213f292085bd0ea7f07cc7b5cd4c940aeaf5d059 /text.lua | |
parent | e7a985bd0a02a1b443cb89ca5ce09506f18a870f (diff) | |
download | view.love-9cafed99f4afbe1b8e7d20d78f623b9ee32579ef.tar.gz |
another bugfix in scrolling while inserting text
I'm being unprincipled at the moment between pos and x,y coordinates. Whatever is more convenient. Perhaps a cleaner approach will come to me over time.
Diffstat (limited to 'text.lua')
-rw-r--r-- | text.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/text.lua b/text.lua index 88ee18d..df491c7 100644 --- a/text.lua +++ b/text.lua @@ -156,9 +156,8 @@ function Text.insert_at_cursor(t) Lines[Cursor1.line].data = string.sub(Lines[Cursor1.line].data, 1, byte_offset-1)..t..string.sub(Lines[Cursor1.line].data, byte_offset) Lines[Cursor1.line].fragments = nil Lines[Cursor1.line].screen_line_starting_pos = nil - local scroll_down = Text.le1(Screen_bottom1, Cursor1) Cursor1.pos = Cursor1.pos+1 - if scroll_down then + if Cursor_y >= App.screen.height - Line_height then Text.populate_screen_line_starting_pos(Cursor1.line) Text.snap_cursor_to_bottom_of_screen() --? print('=>', Screen_top1.line, Screen_top1.pos, Cursor1.line, Cursor1.pos, Screen_bottom1.line, Screen_bottom1.pos) |