diff --git a/ChangeLog b/ChangeLog index 816d49c3b6f701e7f0be336df0b9eedee486ee2b..1c95e0de8164f1cedf8a7d2874a0826c7a09c600 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-05-04 Benno Schulenberg <bensberg@justemail.net> * 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 <bensberg@justemail.net> * src/*.h, src/*.c: Add the ability to colour four elements of diff --git a/src/browser.c b/src/browser.c index 1601a8e62e98e9bd392cfb91fd12c334708fa4e0..30d1ec956f53e7c18a5ac4e7f8f30fb2ffbfc0a3 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 f0f8a48925cc57056fe40f56158a4dcb68f0c090..7f1e3135000dfe8918acfedbd1c94fb77e1fbb74 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 20125d7a4c055092f82f8fff2aaa3e78f301acab..1dce73a458fc337b64c642e12063799a70252b6e 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 1856eef694ea53551ec2d9d493d5316f83b60c02..31e4806a21a57f5c77a5fcadf6c179985a2ec9bc 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 4ab10ddf6dab7f98746ee1bb8ccb357d0144f60d..17a5d70cdb70130a2d6009027d75e8d7b0ada64d 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 308c7e0d6c7c5367eb33fb72d732dee6ba66fb66..c4d00e4a0ec1bc6dabc4eac95c46a81a119e4b90 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 7cf5db61c6c2c1a2beee0f6b52be3a7f7fb647f4..7542f3ce6d7d1688413cdc8903f968eb4397f361 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