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
This commit is contained in:
Benno Schulenberg 2016-03-30 12:09:39 +00:00
parent 400e7ce13f
commit c98afde096
5 changed files with 10 additions and 8 deletions

View File

@ -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 <bensberg@justemail.net>
* src/nano.c (main), src/text.c (do_justify, do_verbatim_input),

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);
}