summaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/window.c b/window.c
index 3ffd748..ee97ed9 100644
--- a/window.c
+++ b/window.c
@@ -49,6 +49,14 @@ int window_handle_event(struct editor_state *editor)
case SDL_TEXTINPUT:
if (editor->mode == EDITOR_MODE_NORMAL)
break;
+ /*
+ * Ignore the first letter after entering insert mode, because it
+ * usually is just 'i'.
+ */
+ if (editor->pressed_insert_key) {
+ editor->pressed_insert_key = 0;
+ break;
+ }
editor_insert_char(editor, *e.text.text);
break;
}