summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2023-01-12 12:35:49 -0700
committercflip <cflip@cflip.net>2023-01-12 12:35:49 -0700
commitb9558f6a53213089372e0aa9795745332cd6209d (patch)
treeb1e18ae6f01642133734fcc9fcf5c2015caed31a
parent2021a3c4c0cd13d3a4f5ac097badb2eaedea1013 (diff)
Manually insert tab characters
Tabs don't show up in the text input event for whatever reason so they need to be manually inserted.
-rw-r--r--input.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/input.c b/input.c
index 7a18441..8a9d673 100644
--- a/input.c
+++ b/input.c
@@ -15,6 +15,9 @@ void editor_process_keypress(struct editor_state *editor, SDL_Keysym *keysym)
if (keysym->sym == SDLK_RETURN)
editor_insert_newline(editor);
+ if (keysym->sym == SDLK_TAB)
+ editor_insert_char(editor, '\t');
+
if (keysym->sym == SDLK_ESCAPE)
editor->mode = EDITOR_MODE_NORMAL;
return;