commit 415e55ff373233f581b6da84fe6243090fe6ab6d
parent c20134c20d26106b2f59248f7fd1afd0ca42c553
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 16 Mar 2020 10:17:15 +0100
tweaks: move a function to before the one that calls it
Diffstat:
M | src/winio.c | | | 40 | ++++++++++++++++++++-------------------- |
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -2280,6 +2280,26 @@ void warn_and_shortly_pause(const char *msg)
napms(1500);
}
+/* Write a key's representation plus a minute description of its function
+ * to the screen. For example, the key could be "^C" and its tag "Cancel".
+ * Key plus tag may occupy at most width columns. */
+void post_one_key(const char *keystroke, const char *tag, int width)
+{
+ wattron(bottomwin, interface_color_pair[KEY_COMBO]);
+ waddnstr(bottomwin, keystroke, actual_x(keystroke, width));
+ wattroff(bottomwin, interface_color_pair[KEY_COMBO]);
+
+ /* If the remaning space is too small, skip the description. */
+ width -= breadth(keystroke);
+ if (width < 2)
+ return;
+
+ waddch(bottomwin, ' ');
+ wattron(bottomwin, interface_color_pair[FUNCTION_TAG]);
+ waddnstr(bottomwin, tag, actual_x(tag, width - 1));
+ wattroff(bottomwin, interface_color_pair[FUNCTION_TAG]);
+}
+
/* Display the shortcut list corresponding to menu on the last two rows
* of the bottom portion of the window. */
void bottombars(int menu)
@@ -2329,26 +2349,6 @@ void bottombars(int menu)
wrefresh(bottomwin);
}
-/* Write a key's representation plus a minute description of its function
- * to the screen. For example, the key could be "^C" and its tag "Cancel".
- * Key plus tag may occupy at most width columns. */
-void post_one_key(const char *keystroke, const char *tag, int width)
-{
- wattron(bottomwin, interface_color_pair[KEY_COMBO]);
- waddnstr(bottomwin, keystroke, actual_x(keystroke, width));
- wattroff(bottomwin, interface_color_pair[KEY_COMBO]);
-
- /* If the remaning space is too small, skip the description. */
- width -= breadth(keystroke);
- if (width < 2)
- return;
-
- waddch(bottomwin, ' ');
- wattron(bottomwin, interface_color_pair[FUNCTION_TAG]);
- waddnstr(bottomwin, tag, actual_x(tag, width - 1));
- wattroff(bottomwin, interface_color_pair[FUNCTION_TAG]);
-}
-
/* Redetermine current_y from the position of current relative to edittop,
* and put the cursor in the edit window at (current_y, "current_x"). */
void place_the_cursor(void)