tweaks: add a separate function that actually wipes the status bar

master
Benno Schulenberg 2017-12-29 17:34:03 +01:00
parent eac90c3eff
commit b574f73e60
7 changed files with 21 additions and 25 deletions

View File

@ -372,8 +372,7 @@ int do_lockfile(const char *filename)
free(promptstr);
if (response < 1) {
blank_statusbar();
wnoutrefresh(bottomwin);
wipe_statusbar();
goto free_the_name;
}
}
@ -2218,8 +2217,7 @@ int do_writeout(bool exiting, bool withprompt)
response = do_yesno_prompt(FALSE, _("File was modified "
"since you opened it; continue saving? "));
blank_statusbar();
wnoutrefresh(bottomwin);
wipe_statusbar();
/* When in tool mode and not called by 'savefile',
* overwrite the file right here when requested. */

View File

@ -710,8 +710,7 @@ void window_init(void)
}
/* In case the terminal shrunk, make sure the status line is clear. */
blank_statusbar();
wnoutrefresh(bottomwin);
wipe_statusbar();
/* Turn the keypad on for the windows, if necessary. */
if (!ISSET(REBIND_KEYPAD)) {

View File

@ -651,8 +651,7 @@ int do_prompt(bool allow_tabs, bool allow_files,
else if (func == do_enter)
retval = (*answer == '\0') ? -2 : 0;
blank_statusbar();
wnoutrefresh(bottomwin);
wipe_statusbar();
#ifdef ENABLE_TABCOMP
/* If we've done tab completion, there might still be a list of
@ -720,8 +719,8 @@ int do_yesno_prompt(bool all, const char *msg)
blank_statusbar();
mvwaddnstr(bottomwin, 0, 0, message, actual_x(message, COLS - 1));
wattroff(bottomwin, interface_color_pair[TITLE_BAR]);
wnoutrefresh(bottomwin);
currmenu = MYESNO;
/* When not replacing, show the cursor while waiting for a key. */

View File

@ -642,6 +642,7 @@ const sc *get_shortcut(int *kbinput);
void blank_row(WINDOW *win, int y, int x, int n);
void blank_edit(void);
void blank_statusbar(void);
void wipe_statusbar(void);
void blank_bottombars(void);
void check_statusblank(void);
char *display_string(const char *buf, size_t column, size_t span, bool isdata);

View File

@ -347,8 +347,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
/* Wipe the "Searching..." message and unset the suppression flag. */
if (feedback > 0) {
blank_statusbar();
wrefresh(bottomwin);
wipe_statusbar();
suppress_cursorpos = FALSE;
}

View File

@ -2502,8 +2502,7 @@ void do_justify(bool full_justify)
/* Mark the buffer for unjustified text as empty. */
jusbuffer = NULL;
blank_statusbar();
wnoutrefresh(bottomwin);
wipe_statusbar();
/* Show "Uncut" again in the help lines, and force their redrawing. */
uncutfunc->desc = uncut_tag;
@ -3322,8 +3321,7 @@ void do_linter(void)
}
}
blank_statusbar();
wnoutrefresh(bottomwin);
wipe_statusbar();
#ifndef NANO_TINY
free_lints_and_return:
@ -3546,10 +3544,8 @@ void do_verbatim_input(void)
/* Unsuppress cursor-position display or blank the statusbar. */
if (ISSET(CONSTANT_SHOW))
suppress_cursorpos = FALSE;
else {
blank_statusbar();
wnoutrefresh(bottomwin);
}
else
wipe_statusbar();
/* Display all the verbatim characters at once, not filtering out
* control characters. */
@ -3622,8 +3618,7 @@ void complete_a_word(void)
pletion_x = 0;
/* Wipe the "No further matches" message. */
blank_statusbar();
wnoutrefresh(bottomwin);
wipe_statusbar();
} else {
/* Remove the attempted completion from the buffer. */
do_undo();

View File

@ -1810,6 +1810,13 @@ void blank_statusbar(void)
blank_row(bottomwin, 0, 0, COLS);
}
/* Wipe the status bar clean and include this in the next screen update. */
void wipe_statusbar(void)
{
blank_row(bottomwin, 0, 0, COLS);
wnoutrefresh(bottomwin);
}
/* If the NO_HELP flag isn't set, blank the last two lines of the bottom
* portion of the window. */
void blank_bottombars(void)
@ -1834,10 +1841,8 @@ void check_statusblank(void)
if (currmenu == MMAIN && ISSET(CONSTANT_SHOW))
return;
if (statusblank == 0) {
blank_statusbar();
wnoutrefresh(bottomwin);
}
if (statusblank == 0)
wipe_statusbar();
/* If the subwindows overlap, make sure to show the edit window now. */
if (LINES == 1)