1
1

tweaks: condense a fragment of code

Этот коммит содержится в:
Benno Schulenberg 2020-01-12 12:32:20 +01:00
родитель 7b0b9a12ea
Коммит 99f0265d34
2 изменённых файлов: 7 добавлений и 9 удалений

Просмотреть файл

@ -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