about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-03-17 19:58:49 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-03-17 19:58:53 -0700
commit81ebc6a55998f59c34a725bd47d77e88fb0eb341 (patch)
treec9cb36a5804a48a06723e480eb7485dd5684eff8 /edit.lua
parentd65b7950a152cf2ffe3149707f5e2040b305d8bd (diff)
downloadtext.love-81ebc6a55998f59c34a725bd47d77e88fb0eb341.tar.gz
bugfix: disallow font size of 0
Thanks Mikoláš Štrajt.
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/edit.lua b/edit.lua
index 1d8e0b3..a939bc4 100644
--- a/edit.lua
+++ b/edit.lua
@@ -368,8 +368,10 @@ function edit.keychord_press(State, chord, key)
     edit.update_font_settings(State, State.font_height+2)
     Text.redraw_all(State)
   elseif chord == 'C--' then
-    edit.update_font_settings(State, State.font_height-2)
-    Text.redraw_all(State)
+    if State.font_height > 2 then
+      edit.update_font_settings(State, State.font_height-2)
+      Text.redraw_all(State)
+    end
   elseif chord == 'C-0' then
     edit.update_font_settings(State, 20)
     Text.redraw_all(State)