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; ...@@ -57,6 +57,9 @@ bool have_palette = FALSE;
/* Whether the colors for the current syntax have been initialized. */ /* Whether the colors for the current syntax have been initialized. */
#endif #endif
bool suppress_cursorpos = FALSE;
/* Should we skip constant position display for current keystroke? */
message_type lastmessage = HUSH; message_type lastmessage = HUSH;
/* Messages of type HUSH should not overwrite type MILD nor ALERT. */ /* Messages of type HUSH should not overwrite type MILD nor ALERT. */
......
...@@ -47,6 +47,8 @@ extern int editwincols; ...@@ -47,6 +47,8 @@ extern int editwincols;
extern bool have_palette; extern bool have_palette;
#endif #endif
extern bool suppress_cursorpos;
extern message_type lastmessage; extern message_type lastmessage;
extern filestruct *pletion_line; extern filestruct *pletion_line;
......
...@@ -361,8 +361,11 @@ int findnextstr(const char *needle, bool whole_word_only, bool have_region, ...@@ -361,8 +361,11 @@ int findnextstr(const char *needle, bool whole_word_only, bool have_region,
if (match_len != NULL) if (match_len != NULL)
*match_len = found_len; *match_len = found_len;
if (feedback > 0) /* Wipe the "Searching..." message and unset the suppression flag. */
if (feedback > 0) {
blank_statusbar(); blank_statusbar();
suppress_cursorpos = FALSE;
}
return 1; return 1;
} }
......
...@@ -2448,10 +2448,8 @@ void do_justify(bool full_justify) ...@@ -2448,10 +2448,8 @@ void do_justify(bool full_justify)
} while (kbinput == KEY_WINCH); } while (kbinput == KEY_WINCH);
#endif #endif
/* If needed, unset the cursor-position suppression flag, so the cursor /* Unset the suppression flag after showing the Unjustify message. */
* position /will/ be displayed upon a return to the main loop. */ suppress_cursorpos = FALSE;
if (ISSET(CONSTANT_SHOW))
do_cursorpos(FALSE);
func = func_from_key(&kbinput); func = func_from_key(&kbinput);
...@@ -3568,7 +3566,7 @@ void do_verbatim_input(void) ...@@ -3568,7 +3566,7 @@ void do_verbatim_input(void)
/* Unsuppress cursor-position display or blank the statusbar. */ /* Unsuppress cursor-position display or blank the statusbar. */
if (ISSET(CONSTANT_SHOW)) if (ISSET(CONSTANT_SHOW))
do_cursorpos(FALSE); suppress_cursorpos = FALSE;
else { else {
blank_statusbar(); blank_statusbar();
wnoutrefresh(bottomwin); wnoutrefresh(bottomwin);
......
...@@ -47,8 +47,6 @@ static bool solitary = FALSE; ...@@ -47,8 +47,6 @@ static bool solitary = FALSE;
/* Whether an Esc arrived by itself -- not as leader of a sequence. */ /* Whether an Esc arrived by itself -- not as leader of a sequence. */
static int statusblank = 0; static int statusblank = 0;
/* The number of keystrokes left before we blank the statusbar. */ /* 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 #ifdef USING_OLD_NCURSES
static bool seen_wide = FALSE; static bool seen_wide = FALSE;
/* Whether we've seen a multicolumn character in the current line. */ /* 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