summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-02-26 23:17:08 -0500
committerpommicket <pommicket@gmail.com>2023-02-26 23:17:08 -0500
commitc59e6a40b2d89650b3cec4f2d0abad38af46ec0b (patch)
tree730b702239706bf7871bb8667273e2bbeb378faf /command.c
parent0f13ab99138c3e5f159b964510f5cf136503feec (diff)
ctrl+scroll to adjust text size
Diffstat (limited to 'command.c')
-rw-r--r--command.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/command.c b/command.c
index 5f92719..36fd2d1 100644
--- a/command.c
+++ b/command.c
@@ -481,20 +481,24 @@ void command_execute(Ted *ted, Command c, i64 argument) {
menu_open(ted, MENU_COMMAND_SELECTOR);
break;
- case CMD_TEXT_SIZE_INCREASE: {
- i64 new_text_size = settings->text_size + argument;
- if (new_text_size >= TEXT_SIZE_MIN && new_text_size <= TEXT_SIZE_MAX) {
- settings->text_size = (u16)new_text_size;
- ted_load_fonts(ted);
+ case CMD_TEXT_SIZE_INCREASE:
+ if (argument != 0) {
+ i64 new_text_size = settings->text_size + argument;
+ if (new_text_size >= TEXT_SIZE_MIN && new_text_size <= TEXT_SIZE_MAX) {
+ settings->text_size = (u16)new_text_size;
+ ted_load_fonts(ted);
+ }
}
- } break;
- case CMD_TEXT_SIZE_DECREASE: {
- i64 new_text_size = settings->text_size - argument;
- if (new_text_size >= TEXT_SIZE_MIN && new_text_size <= TEXT_SIZE_MAX) {
- settings->text_size = (u16)new_text_size;
- ted_load_fonts(ted);
+ break;
+ case CMD_TEXT_SIZE_DECREASE:
+ if (argument != 0) {
+ i64 new_text_size = settings->text_size - argument;
+ if (new_text_size >= TEXT_SIZE_MIN && new_text_size <= TEXT_SIZE_MAX) {
+ settings->text_size = (u16)new_text_size;
+ ted_load_fonts(ted);
+ }
}
- } break;
+ break;
case CMD_VIEW_ONLY:
if (buffer) buffer->view_only = !buffer->view_only;