From a37cd144149859399fa180080189105335675351 Mon Sep 17 00:00:00 2001 From: Riley Beckett Date: Sun, 9 Nov 2025 20:47:44 -0500 Subject: fix forward_word --- keybind.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/keybind.c b/keybind.c index 5e357fb..cb1d52d 100644 --- a/keybind.c +++ b/keybind.c @@ -111,15 +111,13 @@ key_repeat_t backward_char(client_state* state) { key_repeat_t forward_word(client_state* state) { if (state->cursor_index < array_size(state->input_buffer)) { - bool hit_white = false; - for (; state->cursor_index < array_size(state->input_buffer); state->cursor_index++) { - if (state->input_buffer[state->cursor_index] == ' ') { - hit_white = true; - } else if (hit_white) { - break; - } - } - } + for (; state->cursor_index < array_size(state->input_buffer) && + state->input_buffer[state->cursor_index] == ' '; + state->cursor_index++); + for (; state->cursor_index < array_size(state->input_buffer) && + state->input_buffer[state->cursor_index] != ' '; + state->cursor_index++); + } return KEY_REPEAT; } -- cgit v1.2.3