diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-05 11:24:08 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-05 11:27:23 -0700 |
commit | f2e5c4ffee3352268750861bd995386e1a47ecd5 (patch) | |
tree | 98159c1618d16082262b4164863505e392b9f111 /main.lua | |
parent | 3422d92a00bcf6220f6a4bb25f1f4c718e7c9555 (diff) | |
download | text.love-f2e5c4ffee3352268750861bd995386e1a47ecd5.tar.gz |
bugfix: avoid scrolling on 'end'
There's multiple ways to do this, only one of them is right, and I keep forgetting what it is. Turn it into a method.
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/main.lua b/main.lua index 0446825..7321256 100644 --- a/main.lua +++ b/main.lua @@ -517,8 +517,7 @@ function App.keychord_pressed(chord, key) Text.insert_at_cursor(c) end end - App.draw() - if Cursor_y >= App.screen.height - Line_height then + if Text.cursor_past_screen_bottom() then Text.snap_cursor_to_bottom_of_screen() end schedule_save() |