mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 19:39:04 +00:00
Accept some emacs control keys in vi normal mode, from Alexis
Hildebrandt in GitHub issue 2922.
This commit is contained in:
parent
5745bd27fd
commit
9695114230
19
status.c
19
status.c
@ -439,7 +439,8 @@ status_redraw(struct client *c)
|
||||
screen_write_cursormove(&ctx, 0, i, 0);
|
||||
|
||||
status_free_ranges(&sle->ranges);
|
||||
format_draw(&ctx, &gc, width, expanded, &sle->ranges);
|
||||
format_draw(&ctx, &gc, width, expanded, &sle->ranges,
|
||||
0);
|
||||
|
||||
free(sle->expanded);
|
||||
sle->expanded = expanded;
|
||||
@ -562,7 +563,7 @@ status_message_redraw(struct client *c)
|
||||
if (c->message_ignore_styles)
|
||||
screen_write_nputs(&ctx, len, &gc, "%s", c->message_string);
|
||||
else
|
||||
format_draw(&ctx, &gc, c->tty.sx, c->message_string, NULL);
|
||||
format_draw(&ctx, &gc, c->tty.sx, c->message_string, NULL, 0);
|
||||
screen_write_stop(&ctx);
|
||||
|
||||
if (grid_compare(sl->active->grid, old_screen.grid) == 0) {
|
||||
@ -809,14 +810,23 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
|
||||
{
|
||||
if (c->prompt_mode == PROMPT_ENTRY) {
|
||||
switch (key) {
|
||||
case '\001': /* C-a */
|
||||
case '\003': /* C-c */
|
||||
case '\005': /* C-e */
|
||||
case '\007': /* C-g */
|
||||
case '\010': /* C-h */
|
||||
case '\011': /* Tab */
|
||||
case '\013': /* C-k */
|
||||
case '\016': /* C-n */
|
||||
case '\020': /* C-p */
|
||||
case '\024': /* C-t */
|
||||
case '\025': /* C-u */
|
||||
case '\027': /* C-w */
|
||||
case '\031': /* C-y */
|
||||
case '\n':
|
||||
case '\r':
|
||||
case KEYC_LEFT|KEYC_CTRL:
|
||||
case KEYC_RIGHT|KEYC_CTRL:
|
||||
case KEYC_BSPACE:
|
||||
case KEYC_DC:
|
||||
case KEYC_DOWN:
|
||||
@ -837,6 +847,9 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
case KEYC_BSPACE:
|
||||
*new_key = KEYC_LEFT;
|
||||
return (1);
|
||||
case 'A':
|
||||
case 'I':
|
||||
case 'C':
|
||||
@ -882,7 +895,7 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
|
||||
*new_key = 'B'|KEYC_VI;
|
||||
return (1);
|
||||
case 'd':
|
||||
*new_key = '\025';
|
||||
*new_key = '\025'; /* C-u */
|
||||
return (1);
|
||||
case 'e':
|
||||
*new_key = 'e'|KEYC_VI;
|
||||
|
Loading…
Reference in New Issue
Block a user