do_statusbar_input()
- Remove redundant check for allow_funcs' being TRUE when we get
KEY_MOUSE. (DLR)
- do_yesno()
+ - Improve the handling of NANO_REFRESH_KEY. (DLR)
+ total_statusbar_refresh()
+ - New function, called when we get NANO_REFRESH_KEY in
+ do_statusbar_input(). (DLR)
+ do_yesno_prompt()
- Handle the keys in a switch statement instead of a long if
block, for simplicity. (DLR)
- rcfile.c:
if (have_shortcut) {
switch (input) {
/* Handle the "universal" statusbar prompt shortcuts. */
+ case NANO_REFRESH_KEY:
+ total_statusbar_refresh(refresh_func);
+ break;
case NANO_CUT_KEY:
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
'\0' || currshortcut != writefile_list)
do_statusbar_backspace();
break;
- case NANO_REFRESH_KEY:
- refresh_func();
- break;
/* Handle the normal statusbar prompt shortcuts, setting
* ran_func to TRUE if we try to run their associated
* functions and setting finished to TRUE to indicate
start_col - 1);
}
+/* Put the cursor in the statusbar prompt at statusbar_x. */
+void reset_statusbar_cursor(void)
+{
+ size_t start_col = strlenpt(prompt) + 1;
+ size_t xpt = statusbar_xplustabs();
+
+ wmove(bottomwin, 0, start_col + 1 + xpt -
+ get_statusbar_page_start(start_col, start_col + xpt));
+}
+
/* Repaint the statusbar when getting a character in
* get_prompt_string(). The statusbar text line will be displayed
* starting with curranswer[index]. */
wattroff(bottomwin, reverse_attr);
}
-/* Put the cursor in the statusbar prompt at statusbar_x. */
-void reset_statusbar_cursor(void)
-{
- size_t start_col = strlenpt(prompt) + 1;
- size_t xpt = statusbar_xplustabs();
-
- wmove(bottomwin, 0, start_col + 1 + xpt -
- get_statusbar_page_start(start_col, start_col + xpt));
-}
-
/* Return TRUE if we need an update after moving horizontally, and FALSE
* otherwise. We need one if old_pww and statusbar_pww are on different
* pages. */
get_statusbar_page_start(start_col, start_col + statusbar_pww);
}
+/* Unconditionally redraw the entire screen, and then refresh it using
+ * refresh_func(). */
+void total_statusbar_refresh(void (*refresh_func)(void))
+{
+ total_redraw();
+ refresh_func();
+}
+
/* Get a string of input at the statusbar prompt. This should only be
* called from do_prompt(). */
int get_prompt_string(bool allow_tabs,
#endif
size_t statusbar_xplustabs(void);
size_t get_statusbar_page_start(size_t start_col, size_t column);
-void update_statusbar_line(const char *curranswer, size_t index);
void reset_statusbar_cursor(void);
+void update_statusbar_line(const char *curranswer, size_t index);
bool need_statusbar_horizontal_update(size_t old_pww);
+void total_statusbar_refresh(void (*refresh_func)(void));
int get_prompt_string(bool allow_tabs,
#ifndef DISABLE_TABCOMP
bool allow_files,