1
1

tweaks: move a function to after the one that it calls

Этот коммит содержится в:
Benno Schulenberg 2020-01-26 15:41:09 +01:00
родитель 5725336149
Коммит db10a421dc
2 изменённых файлов: 19 добавлений и 19 удалений

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

@ -614,9 +614,9 @@ size_t get_key_buffer_len(void);
#ifdef ENABLE_NANORC #ifdef ENABLE_NANORC
void implant(const char *string); void implant(const char *string);
#endif #endif
int get_kbinput(WINDOW *win, bool showcursor);
int parse_kbinput(WINDOW *win); int parse_kbinput(WINDOW *win);
int parse_escape_sequence(WINDOW *win, int kbinput); int parse_escape_sequence(WINDOW *win, int kbinput);
int get_kbinput(WINDOW *win, bool showcursor);
int get_byte_kbinput(int kbinput); int get_byte_kbinput(int kbinput);
int get_control_kbinput(int kbinput); int get_control_kbinput(int kbinput);
int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len); int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);

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

@ -321,24 +321,6 @@ int *get_input(WINDOW *win, size_t input_len)
return input; return input;
} }
/* Read in a single keystroke, ignoring any that are invalid. */
int get_kbinput(WINDOW *win, bool showcursor)
{
int kbinput = ERR;
reveal_cursor = showcursor;
/* Extract one keystroke from the input stream. */
while (kbinput == ERR)
kbinput = parse_kbinput(win);
/* If we read from the edit window, blank the status bar if needed. */
if (win == edit)
check_statusblank();
return kbinput;
}
/* Extract a single keystroke from the input stream. Translate escape /* Extract a single keystroke from the input stream. Translate escape
* sequences and extended keypad codes into their corresponding values. * sequences and extended keypad codes into their corresponding values.
* Set meta_key to TRUE when appropriate. Supported extended keypad values * Set meta_key to TRUE when appropriate. Supported extended keypad values
@ -1334,6 +1316,24 @@ int parse_escape_sequence(WINDOW *win, int kbinput)
return retval; return retval;
} }
/* Read in a single keystroke, ignoring any that are invalid. */
int get_kbinput(WINDOW *win, bool showcursor)
{
int kbinput = ERR;
reveal_cursor = showcursor;
/* Extract one keystroke from the input stream. */
while (kbinput == ERR)
kbinput = parse_kbinput(win);
/* If we read from the edit window, blank the status bar if needed. */
if (win == edit)
check_statusblank();
return kbinput;
}
/* Turn a three-digit decimal number (from 000 to 255) into its corresponding /* Turn a three-digit decimal number (from 000 to 255) into its corresponding
* byte value. */ * byte value. */
int get_byte_kbinput(int kbinput) int get_byte_kbinput(int kbinput)