commit 162c213e7b68d91d47cce4012249719b2700d6d5
parent 6fde7d8a51a18eb127a375e78b88df6c5e7a7f91
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 26 Sep 2022 15:51:06 +0200
tweaks: improve two comments, and exclude two unneeded prototypes
And declare two more variables as 'static', like all its neighbors.
Diffstat:
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -1607,8 +1607,8 @@ 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 there are gathered bytes and we have a command or no other key codes
+ * are waiting, it's time to insert these bytes into the edit buffer. */
if (depth > 0 && (function || waiting_keycodes() == 0)) {
puddle[depth] = '\0';
inject(puddle, depth);
diff --git a/src/prompt.c b/src/prompt.c
@@ -281,9 +281,8 @@ void absorb_character(int input, functionptrtype function)
}
}
- /* 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 there are gathered bytes and we have a command or no other key codes
+ * are waiting, it's time to insert these bytes into the answer. */
if (depth > 0 && (function || waiting_keycodes() == 0)) {
puddle[depth] = '\0';
inject_into_answer(puddle, depth);
diff --git a/src/prototypes.h b/src/prototypes.h
@@ -579,8 +579,10 @@ linestruct *line_from_number(ssize_t number);
#endif
/* Most functions in winio.c. */
+#ifndef NANO_TINY
void record_macro(void);
void run_macro(void);
+#endif
void reserve_space_for(size_t newsize);
size_t waiting_keycodes(void);
#ifdef ENABLE_NANORC
diff --git a/src/winio.c b/src/winio.c
@@ -62,9 +62,9 @@ static bool linger_after_escape = FALSE;
/* Whether to give ncurses some time to get the next code. */
static int statusblank = 0;
/* The number of keystrokes left before we blank the status bar. */
-size_t from_x = 0;
+static size_t from_x = 0;
/* From where in the relevant line the current row is drawn. */
-size_t till_x = 0;
+static size_t till_x = 0;
/* Until where in the relevant line the current row is drawn. */
static bool has_more = FALSE;
/* Whether the current line has more text after the displayed part. */