Merge branch 'ctrl-c-cancel'

This commit is contained in:
Craig Barnes 2021-05-25 17:03:26 +01:00
commit 3eaf6ead2c
4 changed files with 7 additions and 3 deletions

View file

@ -51,6 +51,7 @@
* XDG activation support, will be used by `[bell].urgent` when * XDG activation support, will be used by `[bell].urgent` when
available (falling back to coloring the window margins red when available (falling back to coloring the window margins red when
unavailable) (https://codeberg.org/dnkl/foot/issues/487). unavailable) (https://codeberg.org/dnkl/foot/issues/487).
* `ctrl`+`c` as a default key binding; to cancel search/url mode.
### Changed ### Changed

View file

@ -2333,6 +2333,7 @@ add_default_search_bindings(struct config *conf)
const struct config_key_modifiers shift = {.shift = true}; const struct config_key_modifiers shift = {.shift = true};
const struct config_key_modifiers ctrl_shift = {.ctrl = true, .shift = true}; const struct config_key_modifiers ctrl_shift = {.ctrl = true, .shift = true};
add_binding(BIND_ACTION_SEARCH_CANCEL, ctrl, XKB_KEY_c);
add_binding(BIND_ACTION_SEARCH_CANCEL, ctrl, XKB_KEY_g); add_binding(BIND_ACTION_SEARCH_CANCEL, ctrl, XKB_KEY_g);
add_binding(BIND_ACTION_SEARCH_CANCEL, none, XKB_KEY_Escape); add_binding(BIND_ACTION_SEARCH_CANCEL, none, XKB_KEY_Escape);
add_binding(BIND_ACTION_SEARCH_COMMIT, none, XKB_KEY_Return); add_binding(BIND_ACTION_SEARCH_COMMIT, none, XKB_KEY_Return);
@ -2374,6 +2375,7 @@ add_default_url_bindings(struct config *conf)
const struct config_key_modifiers none = {0}; const struct config_key_modifiers none = {0};
const struct config_key_modifiers ctrl = {.ctrl = true}; const struct config_key_modifiers ctrl = {.ctrl = true};
add_binding(BIND_ACTION_URL_CANCEL, ctrl, XKB_KEY_c);
add_binding(BIND_ACTION_URL_CANCEL, ctrl, XKB_KEY_g); add_binding(BIND_ACTION_URL_CANCEL, ctrl, XKB_KEY_g);
add_binding(BIND_ACTION_URL_CANCEL, ctrl, XKB_KEY_d); add_binding(BIND_ACTION_URL_CANCEL, ctrl, XKB_KEY_d);
add_binding(BIND_ACTION_URL_CANCEL, none, XKB_KEY_Escape); add_binding(BIND_ACTION_URL_CANCEL, none, XKB_KEY_Escape);

View file

@ -204,7 +204,7 @@ Note that these are just the defaults; they can be changed in
*shift*+*insert* *shift*+*insert*
Paste from primary selection into the search buffer. Paste from primary selection into the search buffer.
*escape*, *ctrl*+*g* *escape*, *ctrl*+*g*, *ctrl*+*c*
Cancel the search Cancel the search
*return* *return*

View file

@ -611,7 +611,8 @@ scrollback search mode. The syntax is exactly the same as the regular
*cancel* *cancel*
Aborts the search. The viewport is restored and the _primary Aborts the search. The viewport is restored and the _primary
selection_ is **not** updated. Default: _Control+g Escape_. selection_ is **not** updated. Default: _Control+g Control+c
Escape_.
*commit* *commit*
Exit search mode and copy current selection into the _primary Exit search mode and copy current selection into the _primary
@ -688,7 +689,7 @@ mode. The syntax is exactly the same as the regular **key-bindings**.
*cancel* *cancel*
Exits URL mode without opening an URL. Default: _Control+g Exits URL mode without opening an URL. Default: _Control+g
Control+d Escape_. Control+c Control+d Escape_.
*toggle-url-visible* *toggle-url-visible*
By default, the jump label only shows the key sequence required to By default, the jump label only shows the key sequence required to