diff options
author | nicm <nicm> | 2016-10-11 07:23:34 +0000 |
---|---|---|
committer | nicm <nicm> | 2016-10-11 07:23:34 +0000 |
commit | 76d6d3641f271be1756e41494960d96714e7ee58 (patch) | |
tree | ff2b551953111d90ed5f32919fe2f3b329357bc1 /window-choose.c | |
parent | 8b804fb5894b6717de36c5c9c96f7fd29b14a864 (diff) | |
download | rtmux-76d6d3641f271be1756e41494960d96714e7ee58.tar.gz rtmux-76d6d3641f271be1756e41494960d96714e7ee58.tar.bz2 rtmux-76d6d3641f271be1756e41494960d96714e7ee58.zip |
Fundamental change to how copy mode key bindings work:
The vi-copy and emacs-copy mode key tables are gone, and instead copy
mode commands are bound in one of two normal key tables ("copy-mode" or
"copy-mode-vi"). Keys are bound to "send-keys -X copy-mode-command". So:
bind -temacs-copy C-Up scroll-up
bind -temacs-copy -R5 WheelUpPane scroll-up
Becomes:
bind -Tcopy-mode C-Up send -X scroll-up
bind -Tcopy-mode WheelUpPane send -N5 -X scroll-up
This allows the full command parser and command set to be used - for
example, we can use the normal command prompt for searching, jumping,
and so on instead of a custom one:
bind -Tcopy-mode C-r command-prompt -p'search up' "send -X search-backward '%%'"
command-prompt also gets a -1 option to only require on key press, which
is needed for jumping.
The plan is to get rid of mode keys entirely, so more to come eventually.
Diffstat (limited to 'window-choose.c')
-rw-r--r-- | window-choose.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/window-choose.c b/window-choose.c index 715915b6..19677c86 100644 --- a/window-choose.c +++ b/window-choose.c @@ -52,10 +52,10 @@ enum window_choose_input_type { }; const struct window_mode window_choose_mode = { - window_choose_init, - window_choose_free, - window_choose_resize, - window_choose_key, + .init = window_choose_init, + .free = window_choose_free, + .resize = window_choose_resize, + .key = window_choose_key, }; struct window_choose_mode_item { @@ -552,7 +552,7 @@ window_choose_key(struct window_pane *wp, __unused struct client *c, items = data->list_size; if (data->input_type == WINDOW_CHOOSE_GOTO_ITEM) { - switch (mode_key_lookup(&data->mdata, key, NULL, NULL)) { + switch (mode_key_lookup(&data->mdata, key)) { case MODEKEYCHOICE_CANCEL: data->input_type = WINDOW_CHOOSE_NORMAL; window_choose_redraw_screen(wp); @@ -582,7 +582,7 @@ window_choose_key(struct window_pane *wp, __unused struct client *c, return; } - switch (mode_key_lookup(&data->mdata, key, NULL, NULL)) { + switch (mode_key_lookup(&data->mdata, key)) { case MODEKEYCHOICE_CANCEL: window_choose_fire_callback(wp, NULL); break; @@ -837,7 +837,7 @@ window_choose_key_index(struct window_choose_mode_data *data, u_int idx) int mkey; for (ptr = keys; *ptr != '\0'; ptr++) { - mkey = mode_key_lookup(&data->mdata, *ptr, NULL, NULL); + mkey = mode_key_lookup(&data->mdata, *ptr); if (mkey != MODEKEY_NONE && mkey != MODEKEY_OTHER) continue; if (idx-- == 0) @@ -857,7 +857,7 @@ window_choose_index_key(struct window_choose_mode_data *data, key_code key) u_int idx = 0; for (ptr = keys; *ptr != '\0'; ptr++) { - mkey = mode_key_lookup(&data->mdata, *ptr, NULL, NULL); + mkey = mode_key_lookup(&data->mdata, *ptr); if (mkey != MODEKEY_NONE && mkey != MODEKEY_OTHER) continue; if (key == (key_code)*ptr) |