aboutsummaryrefslogtreecommitdiff
path: root/keybind.c
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2025-11-05 20:15:24 -0500
committerJack Jamison <jackqjamison@gmail.com>2025-11-06 19:45:21 -0500
commit784f7000f29498e6c111afa78a53950989ee94b6 (patch)
tree8bf46ef56d4e4376227354c722c8c5bad0e6b4b3 /keybind.c
parenta5f6176f7ff33c0200a0686f4ba4ce264d578287 (diff)
more keybinds and fixes
Diffstat (limited to 'keybind.c')
-rw-r--r--keybind.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/keybind.c b/keybind.c
index ec10c58..0a23e5d 100644
--- a/keybind.c
+++ b/keybind.c
@@ -56,6 +56,24 @@ key_repeat_t select_previous(client_state* state) {
return KEY_REPEAT;
}
+key_repeat_t select_first(client_state* state) {
+ if (state->selected_filtered_item != -1) {
+ state->selected_filtered_item = 0;
+ rect_t prompt, input, options;
+ calculate_layout(state, &prompt, &input, &options, true, false);
+ }
+ return KEY_NO_REPEAT;
+}
+
+key_repeat_t select_last(client_state* state) {
+ if (state->selected_filtered_item != -1) {
+ state->selected_filtered_item = array_size(state->filtered_items) - 1;
+ rect_t prompt, input, options;
+ calculate_layout(state, &prompt, &input, &options, true, false);
+ }
+ return KEY_NO_REPEAT;
+}
+
key_repeat_t goto_end(client_state* state) {
state->cursor_index = array_size(state->input_buffer);
return KEY_NO_REPEAT;
@@ -66,6 +84,16 @@ key_repeat_t goto_start(client_state* state) {
return KEY_NO_REPEAT;
}
+key_repeat_t forward_char_or_select_next(client_state* state) {
+ if (state->cursor_index < array_size(state->input_buffer)) return forward_char(state);
+ else return select_next(state);
+}
+
+key_repeat_t backward_char_or_select_previous(client_state* state) {
+ if (state->cursor_index > 0) return backward_char(state);
+ else return select_previous(state);
+}
+
key_repeat_t forward_char(client_state* state) {
if (state->cursor_index < array_size(state->input_buffer)) {
state->cursor_index++;