From c98afde096a042398909dbb59390e3d486d73e3c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 30 Mar 2016 12:09:39 +0000 Subject: [PATCH] Renaming 'do_replace_highlight()' to 'spotlight()', for clarity, for aptness, for contrast. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5777 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ src/proto.h | 2 +- src/search.c | 4 ++-- src/text.c | 4 ++-- src/winio.c | 6 +++--- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c779a1a..f65c8db9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * src/search.c (do_replace_loop, go_looking, findnextstr): Report "Cancelled" instead of "Not found" when the user aborts a replace that is taking too long. This fixes Savannah bug #47439. + * src/winio.c (do_replace_highlight): Rename this to 'spotlight', + for clarity, and for contrast with 'do_replace/do_replace_loop'. 2016-03-29 Benno Schulenberg * src/nano.c (main), src/text.c (do_justify, do_verbatim_input), diff --git a/src/proto.h b/src/proto.h index 764634cf..17f0f4ab 100644 --- a/src/proto.h +++ b/src/proto.h @@ -802,7 +802,7 @@ void total_refresh(void); void display_main_list(void); void do_cursorpos(bool constant); void do_cursorpos_void(void); -void do_replace_highlight(bool highlight, const char *word); +void spotlight(bool active, const char *word); void xon_complaint(void); void xoff_complaint(void); void do_suspend_void(void); diff --git a/src/search.c b/src/search.c index daa608d9..e1965f79 100644 --- a/src/search.c +++ b/src/search.c @@ -686,12 +686,12 @@ ssize_t do_replace_loop( /* Don't show cursor, to not distract from highlighted match. */ curs_set(0); - do_replace_highlight(TRUE, exp_word); + spotlight(TRUE, exp_word); /* TRANSLATORS: This is a prompt. */ i = do_yesno_prompt(TRUE, _("Replace this instance?")); - do_replace_highlight(FALSE, exp_word); + spotlight(FALSE, exp_word); free(exp_word); diff --git a/src/text.c b/src/text.c index 2d096a16..38dd4984 100644 --- a/src/text.c +++ b/src/text.c @@ -2429,7 +2429,7 @@ bool do_int_spell_fix(const char *word) edit_refresh(); - do_replace_highlight(TRUE, exp_word); + spotlight(TRUE, exp_word); /* Allow all instances of the word to be corrected. */ canceled = (do_prompt(FALSE, @@ -2442,7 +2442,7 @@ bool do_int_spell_fix(const char *word) #endif edit_refresh, _("Edit a replacement")) == -1); - do_replace_highlight(FALSE, exp_word); + spotlight(FALSE, exp_word); free(exp_word); diff --git a/src/winio.c b/src/winio.c index ffe1a05e..9c33f3a6 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3149,7 +3149,7 @@ void disable_nodelay(void) /* Highlight the current word being replaced or spell checked. We * expect word to have tabs and control characters expanded. */ -void do_replace_highlight(bool highlight, const char *word) +void spotlight(bool active, const char *word) { size_t y = xplustabs(), word_len = strlenpt(word); @@ -3165,7 +3165,7 @@ void do_replace_highlight(bool highlight, const char *word) reset_cursor(); wnoutrefresh(edit); - if (highlight) + if (active) wattron(edit, hilite_attribute); /* This is so we can show zero-length matches. */ @@ -3177,7 +3177,7 @@ void do_replace_highlight(bool highlight, const char *word) if (word_len > y) waddch(edit, '$'); - if (highlight) + if (active) wattroff(edit, hilite_attribute); } -- 2.39.5