diff options
| author | Riley Beckett <rbeckettvt@gmail.com> | 2025-11-09 20:47:44 -0500 |
|---|---|---|
| committer | Riley Beckett <rbeckettvt@gmail.com> | 2025-11-09 20:47:44 -0500 |
| commit | a37cd144149859399fa180080189105335675351 (patch) | |
| tree | 3926703ceee71c71f0b118d207acf88ca71d4073 | |
| parent | c078f5275f27a8812301a7d9c795ab4284d69bd3 (diff) | |
fix forward_word
| -rw-r--r-- | keybind.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -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; } |
