summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenno Schulenberg <bensberg@telfort.nl>2019-02-09 10:45:50 +0100
committerBenno Schulenberg <bensberg@telfort.nl>2019-02-12 15:07:55 +0100
commit14f32577eecfe9d6aa26aaaaa11ea32e534baae0 (patch)
tree6035e9fe2b81b61a9bc8e596c304031060d07a97
parent5618189643f285d40f7c92048e59813512d86b48 (diff)
downloadnano-14f32577.tar.gz
display: ensure that spotlighted text is not treated as a prompt answer
When doing replacements or fixing misspelled words, and edit_refresh() is called to highlight the relevant word, then the current menu can be anything from MREPLACEWITH, MYESNO, MSPELL, or MMAIN. Make sure it is always set to the latter just before calling edit_refresh(), so that display_string() will use the full length and the word gets properly highlighted. This fixes https://savannah.gnu.org/bugs/?55680. Reported-by: David Lawrence Ramsey <pooka109@gmail.com> Bug was introduced by the previous commit, 56181896.
-rw-r--r--src/search.c1
-rw-r--r--src/text.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/search.c b/src/search.c
index 33ced4c..5790c26 100644
--- a/src/search.c
+++ b/src/search.c
@@ -579,6 +579,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
light_from_col = xplustabs();
light_to_col = strnlenpt(openfile->current->data,
openfile->current_x + match_len);
+ currmenu = MMAIN;
/* Refresh the edit window, scrolling it if necessary. */
edit_refresh();
diff --git a/src/text.c b/src/text.c
index 5ffdb07..acf0b86 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2202,6 +2202,7 @@ bool fix_spello(const char *word)
filestruct *saved_mark = openfile->mark;
openfile->mark = NULL;
#endif
+ currmenu = MMAIN;
edit_refresh();
/* Let the user supply a correctly spelled alternative. */