From 81ebc6a55998f59c34a725bd47d77e88fb0eb341 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 17 Mar 2023 19:58:49 -0700 Subject: [PATCH] bugfix: disallow font size of 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks Mikoláš Štrajt. --- edit.lua | 6 ++++-- source_edit.lua | 6 ++++-- 2 files changed, 8 insertions(+), 4 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) diff --git a/source_edit.lua b/source_edit.lua index f340ab3..5c90075 100644 --- a/source_edit.lua +++ b/source_edit.lua @@ -405,8 +405,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)