aboutsummaryrefslogtreecommitdiff
path: root/keybind.c
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2025-11-05 14:11:42 -0500
committerJack Jamison <jackqjamison@gmail.com>2025-11-06 19:45:19 -0500
commit3971f0faeaa5254a5b2145685549e0b78266ba06 (patch)
tree76241fa4cd42a214c33aae1f41d0e39cb7c3112f /keybind.c
parentd2d5f7c9a78b0e8d186953ff81c52b66b684da9f (diff)
improve keybinds slightly
Diffstat (limited to 'keybind.c')
-rw-r--r--keybind.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/keybind.c b/keybind.c
index 1d8cfba..ec10c58 100644
--- a/keybind.c
+++ b/keybind.c
@@ -131,9 +131,15 @@ key_repeat_t kill_to_end(client_state* state) {
key_repeat_t delete_word(client_state* state) {
if (state->cursor_index != array_size(state->input_buffer)) {
size_t endidx = state->cursor_index;
+ bool hit_non_white = false;
for (; endidx < array_size(state->input_buffer) - 1; endidx++) {
if (state->input_buffer[endidx] == ' ') {
- break;
+ if (hit_non_white) {
+ endidx--;
+ break;
+ }
+ } else {
+ hit_non_white = true;
}
}
array_erase_range(state->input_buffer, state->cursor_index, endidx);