mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-23 08:44:50 +03:00
tweaks: rename a function, to be more distinct
So one doesn't find it when grepping for get_input().
This commit is contained in:
parent
452008c81d
commit
18bf2af9c1
18
src/winio.c
18
src/winio.c
@ -259,7 +259,7 @@ size_t get_key_buffer_len(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Add the given keycode to the front of the keystroke buffer. */
|
/* Add the given keycode to the front of the keystroke buffer. */
|
||||||
void unget_input(int keycode)
|
void put_back(int keycode)
|
||||||
{
|
{
|
||||||
/* If the keystroke buffer is at maximum capacity, don't add anything. */
|
/* If the keystroke buffer is at maximum capacity, don't add anything. */
|
||||||
if (key_buffer_len + 1 < key_buffer_len)
|
if (key_buffer_len + 1 < key_buffer_len)
|
||||||
@ -280,10 +280,10 @@ void unget_input(int keycode)
|
|||||||
* is a Meta key, also insert an Escape character in front of it. */
|
* is a Meta key, also insert an Escape character in front of it. */
|
||||||
void unget_kbinput(int kbinput, bool metakey)
|
void unget_kbinput(int kbinput, bool metakey)
|
||||||
{
|
{
|
||||||
unget_input(kbinput);
|
put_back(kbinput);
|
||||||
|
|
||||||
if (metakey)
|
if (metakey)
|
||||||
unget_input(ESC_CODE);
|
put_back(ESC_CODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try to read input_len codes from the keystroke buffer. If the
|
/* Try to read input_len codes from the keystroke buffer. If the
|
||||||
@ -458,7 +458,7 @@ int parse_kbinput(WINDOW *win)
|
|||||||
/* Insert the byte(s) into the input buffer. */
|
/* Insert the byte(s) into the input buffer. */
|
||||||
for (i = count; i > 0 ; i--) {
|
for (i = count; i > 0 ; i--) {
|
||||||
onebyte = (unsigned char)multibyte[i - 1];
|
onebyte = (unsigned char)multibyte[i - 1];
|
||||||
unget_input(onebyte);
|
put_back(onebyte);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(multibyte);
|
free(multibyte);
|
||||||
@ -1274,14 +1274,14 @@ int parse_escape_sequence(WINDOW *win, int kbinput)
|
|||||||
/* Put back the non-escape code, then grab at most five integers
|
/* Put back the non-escape code, then grab at most five integers
|
||||||
* (the longest possible escape sequence) from the keybuffer and
|
* (the longest possible escape sequence) from the keybuffer and
|
||||||
* translate the sequence into its corresponding keycode. */
|
* translate the sequence into its corresponding keycode. */
|
||||||
unget_input(kbinput);
|
put_back(kbinput);
|
||||||
length = (key_buffer_len < 5 ? key_buffer_len : 5);
|
length = (key_buffer_len < 5 ? key_buffer_len : 5);
|
||||||
sequence = get_input(NULL, length);
|
sequence = get_input(NULL, length);
|
||||||
retval = convert_sequence(sequence, length, &consumed);
|
retval = convert_sequence(sequence, length, &consumed);
|
||||||
|
|
||||||
/* If not all grabbed integers were consumed, put the leftovers back. */
|
/* If not all grabbed integers were consumed, put the leftovers back. */
|
||||||
for (int i = length - 1; i >= consumed; i--)
|
for (int i = length - 1; i >= consumed; i--)
|
||||||
unget_input(sequence[i]);
|
put_back(sequence[i]);
|
||||||
|
|
||||||
free(sequence);
|
free(sequence);
|
||||||
|
|
||||||
@ -1540,7 +1540,7 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count)
|
|||||||
|
|
||||||
/* If the first code isn't the digit 0 nor 1, put it back. */
|
/* If the first code isn't the digit 0 nor 1, put it back. */
|
||||||
if (unicode != ERR)
|
if (unicode != ERR)
|
||||||
unget_input(*kbinput);
|
put_back(*kbinput);
|
||||||
/* Otherwise, continue reading in digits until we have a complete
|
/* Otherwise, continue reading in digits until we have a complete
|
||||||
* Unicode value, and put back the corresponding byte(s). */
|
* Unicode value, and put back the corresponding byte(s). */
|
||||||
else {
|
else {
|
||||||
@ -1562,7 +1562,7 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count)
|
|||||||
/* Insert the multibyte sequence into the input buffer. */
|
/* Insert the multibyte sequence into the input buffer. */
|
||||||
for (i = *count; i > 0 ; i--) {
|
for (i = *count; i > 0 ; i--) {
|
||||||
onebyte = (unsigned char)multibyte[i - 1];
|
onebyte = (unsigned char)multibyte[i - 1];
|
||||||
unget_input(onebyte);
|
put_back(onebyte);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(multibyte);
|
free(multibyte);
|
||||||
@ -1570,7 +1570,7 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count)
|
|||||||
} else
|
} else
|
||||||
#endif /* ENABLE_UTF8 */
|
#endif /* ENABLE_UTF8 */
|
||||||
/* Put back the first code. */
|
/* Put back the first code. */
|
||||||
unget_input(*kbinput);
|
put_back(*kbinput);
|
||||||
|
|
||||||
free(kbinput);
|
free(kbinput);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user