about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-05 11:24:08 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-05 11:27:23 -0700
commitf2e5c4ffee3352268750861bd995386e1a47ecd5 (patch)
tree98159c1618d16082262b4164863505e392b9f111 /main.lua
parent3422d92a00bcf6220f6a4bb25f1f4c718e7c9555 (diff)
downloadtext.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.lua3
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()