From c970035001e8947b2a99d1c2a5fdb7a1f2afff59 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 4 May 2014 08:53:06 +0000 Subject: [PATCH] Renaming a variable, and removing an unneeded call of wattroff(). git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4834 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ src/browser.c | 4 ++-- src/color.c | 2 +- src/global.c | 2 +- src/help.c | 1 - src/nano.c | 8 ++++---- src/proto.h | 2 +- src/winio.c | 8 ++++---- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 816d49c3..1c95e0de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-05-04 Benno Schulenberg * src/winio.c (statusbar): Elide a variable. + * src/*: Rename the variable 'reverse_attr' to 'hilite_attribute', + and remove an unneeded call of wattroff(). 2014-05-03 Benno Schulenberg * src/*.h, src/*.c: Add the ability to colour four elements of diff --git a/src/browser.c b/src/browser.c index 1601a8e6..30d1ec95 100644 --- a/src/browser.c +++ b/src/browser.c @@ -633,7 +633,7 @@ void browser_refresh(void) /* Start highlighting the currently selected file or * directory. */ if (i == selected) - wattron(edit, reverse_attr); + wattron(edit, hilite_attribute); blank_line(edit, line, col, longest); @@ -708,7 +708,7 @@ void browser_refresh(void) /* Finish highlighting the currently selected file or * directory. */ if (i == selected) - wattroff(edit, reverse_attr); + wattroff(edit, hilite_attribute); free(foo); diff --git a/src/color.c b/src/color.c index f0f8a489..7f1e3135 100644 --- a/src/color.c +++ b/src/color.c @@ -59,7 +59,7 @@ void set_colorpairs(void) interface_color_pair[i] = COLOR_PAIR(i + 1); } else if (i != FUNCTION_TAG) - interface_color_pair[i] = reverse_attr; + interface_color_pair[i] = hilite_attribute; if (specified_color_combo[i] != NULL) { free(specified_color_combo[i]); diff --git a/src/global.c b/src/global.c index 20125d7a..1dce73a4 100644 --- a/src/global.c +++ b/src/global.c @@ -203,7 +203,7 @@ regmatch_t regmatches[10]; * maximum, used in regular expression searches. */ #endif -int reverse_attr = A_REVERSE; +int hilite_attribute = A_REVERSE; /* The curses attribute we use for reverse video. */ #ifndef DISABLE_COLOR char* specified_color_combo[] = {}; diff --git a/src/help.c b/src/help.c index 1856eef6..31e4806a 100644 --- a/src/help.c +++ b/src/help.c @@ -57,7 +57,6 @@ void do_help(void (*refresh_func)(void)) curs_set(0); blank_edit(); - wattroff(bottomwin, reverse_attr); blank_statusbar(); /* Set help_text as the string to display. */ diff --git a/src/nano.c b/src/nano.c index 4ab10ddf..17a5d70c 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2513,7 +2513,7 @@ int main(int argc, char **argv) /* If we're using bold text instead of reverse video text, set it up * now. */ if (ISSET(BOLD_TEXT)) - reverse_attr = A_BOLD; + hilite_attribute = A_BOLD; #ifndef NANO_TINY /* Set up the search/replace history. */ @@ -2660,9 +2660,9 @@ int main(int argc, char **argv) #ifndef DISABLE_COLOR set_colorpairs(); #else - interface_color_pair[TITLE_BAR] = reverse_attr; - interface_color_pair[STATUS_BAR] = reverse_attr; - interface_color_pair[KEY_COMBO] = reverse_attr; + interface_color_pair[TITLE_BAR] = hilite_attribute; + interface_color_pair[STATUS_BAR] = hilite_attribute; + interface_color_pair[KEY_COMBO] = hilite_attribute; interface_color_pair[FUNCTION_TAG] = A_NORMAL; #endif diff --git a/src/proto.h b/src/proto.h index 308c7e0d..c4d00e4a 100644 --- a/src/proto.h +++ b/src/proto.h @@ -130,7 +130,7 @@ extern regex_t search_regexp; extern regmatch_t regmatches[10]; #endif -extern int reverse_attr; +extern int hilite_attribute; #ifndef DISABLE_COLOR extern char* specified_color_combo[NUMBER_OF_ELEMENTS]; #endif diff --git a/src/winio.c b/src/winio.c index 7cf5db61..7542f3ce 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2820,10 +2820,10 @@ void edit_draw(filestruct *fileptr, const char *converted, int if (paintlen > 0) paintlen = actual_x(converted + index, paintlen); - wattron(edit, reverse_attr); + wattron(edit, hilite_attribute); mvwaddnstr(edit, line, x_start, converted + index, paintlen); - wattroff(edit, reverse_attr); + wattroff(edit, hilite_attribute); } } #endif /* !NANO_TINY */ @@ -3383,7 +3383,7 @@ void do_replace_highlight(bool highlight, const char *word) wnoutrefresh(edit); if (highlight) - wattron(edit, reverse_attr); + wattron(edit, hilite_attribute); /* This is so we can show zero-length matches. */ if (word_len == 0) @@ -3395,7 +3395,7 @@ void do_replace_highlight(bool highlight, const char *word) waddch(edit, '$'); if (highlight) - wattroff(edit, reverse_attr); + wattroff(edit, hilite_attribute); } #ifndef DISABLE_EXTRA -- 2.39.5