rcfile: reject an attempt to bind ^[
Also, for <Esc> <Esc> [, report that it is unbindable. This fixes https://savannah.gnu.org/bugs/?55336.
Этот коммит содержится в:
родитель
fb4ce71cfc
Коммит
34b8d58871
@ -1568,7 +1568,9 @@ void unbound_key(int code)
|
||||
statusline(ALERT, _("Unbindable key: M-["));
|
||||
else
|
||||
statusline(ALERT, _("Unbound key: M-%c"), toupper(code));
|
||||
} else if (code < 0x20)
|
||||
} else if (code == ESC_CODE)
|
||||
statusline(ALERT, _("Unbindable key: ^["));
|
||||
else if (code < 0x20)
|
||||
statusline(ALERT, _("Unbound key: ^%c"), code + 0x40);
|
||||
else
|
||||
statusline(ALERT, _("Unbound key: %c"), code);
|
||||
|
@ -464,9 +464,10 @@ void parse_binding(char *ptr, bool dobind)
|
||||
newsc->menus = menu;
|
||||
assign_keyinfo(newsc, keycopy, 0);
|
||||
|
||||
/* Do not allow rebinding a frequent escape-sequence starter: Esc [. */
|
||||
if (newsc->meta && newsc->keycode == 91) {
|
||||
rcfile_error(N_("Sorry, keystroke \"%s\" may not be rebound"), newsc->keystr);
|
||||
/* Disallow rebinding ^[ and frequent escape-sequence starter "Esc [". */
|
||||
if ((!newsc->meta && newsc->keycode == ESC_CODE) ||
|
||||
(newsc->meta && newsc->keycode == '[')) {
|
||||
rcfile_error(N_("Keystroke %s may not be rebound"), keycopy);
|
||||
free_things:
|
||||
free(keycopy);
|
||||
free(newsc);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user