aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keybind.c16
1 files 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;
}