commit f261a8aca51a23fce42e91791ea06d4deda62932
parent bdf64d660ba559a387c9abe5901fac7d24ece801
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 24 Jan 2022 16:49:04 +0100
tweaks: rename a function, to not contain the name of a variable
Diffstat:
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -1583,7 +1583,7 @@ void process_a_keystroke(void)
/* If we have a command, or if there aren't any other key codes waiting,
* it's time to insert the gathered bytes into the edit buffer. */
- if ((shortcut || get_key_buffer_len() == 0) && puddle != NULL) {
+ if ((shortcut || waiting_keycodes() == 0) && puddle != NULL) {
puddle[depth] = '\0';
inject(puddle, depth);
@@ -2545,7 +2545,7 @@ int main(int argc, char **argv)
confirm_margin();
#endif
#ifdef __linux__
- if (on_a_vt && get_key_buffer_len() == 0)
+ if (on_a_vt && waiting_keycodes() == 0)
mute_modifiers = FALSE;
#endif
if (currmenu != MMAIN)
@@ -2559,7 +2559,7 @@ int main(int argc, char **argv)
/* Update the displayed current cursor position only when there
* is no message and no keys are waiting in the input buffer. */
if (ISSET(CONSTANT_SHOW) && lastmessage == VACUUM && LINES > 1 &&
- !ISSET(ZERO) && get_key_buffer_len() == 0)
+ !ISSET(ZERO) && waiting_keycodes() == 0)
report_cursor_position();
as_an_at = TRUE;
diff --git a/src/prompt.c b/src/prompt.c
@@ -290,7 +290,7 @@ int do_statusbar_input(bool *finished)
/* If we got a shortcut, or if there aren't any other keystrokes waiting,
* it's time to insert all characters in the input buffer (if not empty)
* into the answer, and then clear the input buffer. */
- if ((shortcut || get_key_buffer_len() == 0) && puddle != NULL) {
+ if ((shortcut || waiting_keycodes() == 0) && puddle != NULL) {
puddle[depth] = '\0';
inject_into_answer(puddle, depth);
@@ -717,7 +717,7 @@ int ask_user(bool withall, const char *question)
if (using_utf8() && 0xC0 <= kbinput && kbinput <= 0xF7) {
int extras = (kbinput / 16) % 4 + (kbinput <= 0xCF ? 1 : 0);
- while (extras <= get_key_buffer_len() && extras-- > 0)
+ while (extras <= waiting_keycodes() && extras-- > 0)
letter[index++] = (unsigned char)get_kbinput(bottomwin, !withall);
}
#endif
diff --git a/src/prototypes.h b/src/prototypes.h
@@ -568,7 +568,7 @@ linestruct *line_from_number(ssize_t number);
/* Most functions in winio.c. */
void record_macro(void);
void run_macro(void);
-size_t get_key_buffer_len(void);
+size_t waiting_keycodes(void);
#ifdef ENABLE_NANORC
void implant(const char *string);
#endif
diff --git a/src/winio.c b/src/winio.c
@@ -295,7 +295,7 @@ void read_keys_from(WINDOW *win)
}
/* Return the number of key codes waiting in the keystroke buffer. */
-size_t get_key_buffer_len(void)
+size_t waiting_keycodes(void)
{
return waiting_codes;
}