tweaks: condense a fragment of code
Этот коммит содержится в:
родитель
7b0b9a12ea
Коммит
99f0265d34
15
src/global.c
15
src/global.c
@ -454,15 +454,12 @@ const keystruct *get_shortcut(int *kbinput)
|
|||||||
(*kbinput >= 0xA0 && *kbinput <= 0xFF)))
|
(*kbinput >= 0xA0 && *kbinput <= 0xFF)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (bracketed_paste && *kbinput != BRACKETED_PASTE_MARKER) {
|
/* During a paste, ignore all command keycodes at a prompt, and
|
||||||
/* Beep and ignore all non-printable characters in prompts. */
|
* allow only <Tab> and <Enter> to pass into the edit window. */
|
||||||
if (currmenu != MMAIN)
|
if (bracketed_paste && *kbinput != BRACKETED_PASTE_MARKER &&
|
||||||
return NULL;
|
(currmenu != MMAIN ||
|
||||||
|
(*kbinput != TAB_CODE && *kbinput != CR_CODE)))
|
||||||
/* Beep and ignore most non-printable characters in buffer. */
|
return NULL;
|
||||||
if (*kbinput != 0x09 && *kbinput != 0xD)
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (keystruct *s = sclist; s != NULL; s = s->next) {
|
for (keystruct *s = sclist; s != NULL; s = s->next) {
|
||||||
if ((s->menus & currmenu) && *kbinput == s->keycode &&
|
if ((s->menus & currmenu) && *kbinput == s->keycode &&
|
||||||
|
@ -569,6 +569,7 @@ enum
|
|||||||
/* Basic control codes. */
|
/* Basic control codes. */
|
||||||
#define BS_CODE 0x08
|
#define BS_CODE 0x08
|
||||||
#define TAB_CODE 0x09
|
#define TAB_CODE 0x09
|
||||||
|
#define CR_CODE 0x0D
|
||||||
#define ESC_CODE 0x1B
|
#define ESC_CODE 0x1B
|
||||||
#define DEL_CODE 0x7F
|
#define DEL_CODE 0x7F
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user