From b9558f6a53213089372e0aa9795745332cd6209d Mon Sep 17 00:00:00 2001 From: cflip Date: Thu, 12 Jan 2023 12:35:49 -0700 Subject: Manually insert tab characters Tabs don't show up in the text input event for whatever reason so they need to be manually inserted. --- input.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- cgit v1.2.3