Commit 6ad3d3d6 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

display: show the cursor position also when searching took a while

Achieve this by making the suppression flag global, so that we can
just reset it instead of making an improper call of do_cursorpos().

This fixes the secondary part of https://savannah.gnu.org/bugs/?51134.
No related merge requests found
Showing with 12 additions and 8 deletions
+12 -8
......@@ -57,6 +57,9 @@ bool have_palette = FALSE;
/* Whether the colors for the current syntax have been initialized. */
#endif
bool suppress_cursorpos = FALSE;
/* Should we skip constant position display for current keystroke? */
message_type lastmessage = HUSH;
/* Messages of type HUSH should not overwrite type MILD nor ALERT. */
......
......@@ -47,6 +47,8 @@ extern int editwincols;
extern bool have_palette;
#endif
extern bool suppress_cursorpos;
extern message_type lastmessage;
extern filestruct *pletion_line;
......
......@@ -361,8 +361,11 @@ int findnextstr(const char *needle, bool whole_word_only, bool have_region,
if (match_len != NULL)
*match_len = found_len;
if (feedback > 0)
/* Wipe the "Searching..." message and unset the suppression flag. */
if (feedback > 0) {
blank_statusbar();
suppress_cursorpos = FALSE;
}
return 1;
}
......
......@@ -2448,10 +2448,8 @@ void do_justify(bool full_justify)
} while (kbinput == KEY_WINCH);
#endif
/* If needed, unset the cursor-position suppression flag, so the cursor
* position /will/ be displayed upon a return to the main loop. */
if (ISSET(CONSTANT_SHOW))
do_cursorpos(FALSE);
/* Unset the suppression flag after showing the Unjustify message. */
suppress_cursorpos = FALSE;
func = func_from_key(&kbinput);
......@@ -3568,7 +3566,7 @@ void do_verbatim_input(void)
/* Unsuppress cursor-position display or blank the statusbar. */
if (ISSET(CONSTANT_SHOW))
do_cursorpos(FALSE);
suppress_cursorpos = FALSE;
else {
blank_statusbar();
wnoutrefresh(bottomwin);
......
......@@ -47,8 +47,6 @@ static bool solitary = FALSE;
/* Whether an Esc arrived by itself -- not as leader of a sequence. */
static int statusblank = 0;
/* The number of keystrokes left before we blank the statusbar. */
static bool suppress_cursorpos = FALSE;
/* Should we skip constant position display for one keystroke? */
#ifdef USING_OLD_NCURSES
static bool seen_wide = FALSE;
/* Whether we've seen a multicolumn character in the current line. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment