From b9deb883fae414e4ae99ec9cf6b386e74f9bb9e1 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 1 May 2020 13:25:15 +0200 Subject: [PATCH] tweaks: shorten the name of a symbol, to match its bindable function --- src/color.c | 2 +- src/global.c | 4 ++-- src/help.c | 2 +- src/nano.c | 4 ++-- src/nano.h | 2 +- src/rcfile.c | 2 +- src/search.c | 2 +- src/winio.c | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/color.c b/src/color.c index df706dd7..4abe2184 100644 --- a/src/color.c +++ b/src/color.c @@ -315,7 +315,7 @@ void precalc_multicolorinfo(void) regmatch_t startmatch, endmatch; linestruct *line, *tailline; - if (openfile->syntax == NULL || ISSET(NO_COLOR_SYNTAX)) + if (openfile->syntax == NULL || ISSET(NO_SYNTAX)) return; /* For each line, allocate cache space for the multiline-regex info. */ diff --git a/src/global.c b/src/global.c index 0b829f2b..84103d26 100644 --- a/src/global.c +++ b/src/global.c @@ -1329,7 +1329,7 @@ void shortcut_init(void) #endif add_to_sclist(MMAIN, "M-P", 0, do_toggle_void, WHITESPACE_DISPLAY); #ifdef ENABLE_COLOR - add_to_sclist(MMAIN, "M-Y", 0, do_toggle_void, NO_COLOR_SYNTAX); + add_to_sclist(MMAIN, "M-Y", 0, do_toggle_void, NO_SYNTAX); #endif /* Group of "Editing-behavior" toggles. */ @@ -1471,7 +1471,7 @@ const char *flagtostr(int flag) return N_("Soft wrapping of overlong lines"); case WHITESPACE_DISPLAY: return N_("Whitespace display"); - case NO_COLOR_SYNTAX: + case NO_SYNTAX: return N_("Color syntax highlighting"); case SMART_HOME: return N_("Smart home key"); diff --git a/src/help.c b/src/help.c index 4691d3c0..c6fbc003 100644 --- a/src/help.c +++ b/src/help.c @@ -553,7 +553,7 @@ void help_init(void) if (s->toggle && s->ordinal == counter) { ptr += sprintf(ptr, "%s\t\t %s %s\n", (s->menus == MMAIN ? s->keystr : ""), _(flagtostr(s->toggle)), _("enable/disable")); - if (s->toggle == NO_COLOR_SYNTAX || s->toggle == TABS_TO_SPACES) + if (s->toggle == NO_SYNTAX || s->toggle == TABS_TO_SPACES) ptr += sprintf(ptr, "\n"); break; } diff --git a/src/nano.c b/src/nano.c index dce34793..07214b20 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1091,7 +1091,7 @@ void do_toggle(int flag) refresh_needed = TRUE; break; #ifdef ENABLE_COLOR - case NO_COLOR_SYNTAX: + case NO_SYNTAX: refresh_needed = TRUE; break; #endif @@ -1099,7 +1099,7 @@ void do_toggle(int flag) enabled = ISSET(flag); - if (flag == NO_HELP || flag == NO_COLOR_SYNTAX) + if (flag == NO_HELP || flag == NO_SYNTAX) enabled = !enabled; statusline(HUSH, "%s %s", _(flagtostr(flag)), diff --git a/src/nano.h b/src/nano.h index 7976ab49..dffabe70 100644 --- a/src/nano.h +++ b/src/nano.h @@ -512,7 +512,7 @@ enum NO_CONVERT, BACKUP_FILE, INSECURE_BACKUP, - NO_COLOR_SYNTAX, + NO_SYNTAX, PRESERVE, HISTORYLOG, RESTRICTED, diff --git a/src/rcfile.c b/src/rcfile.c index 2ab2de59..6eca8132 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -455,7 +455,7 @@ keystruct *strtosc(const char *input) s->toggle = WHITESPACE_DISPLAY; #ifdef ENABLE_COLOR else if (!strcmp(input, "nosyntax")) - s->toggle = NO_COLOR_SYNTAX; + s->toggle = NO_SYNTAX; #endif else if (!strcmp(input, "smarthome")) s->toggle = SMART_HOME; diff --git a/src/search.c b/src/search.c index dc93c8db..d096ec1f 100644 --- a/src/search.c +++ b/src/search.c @@ -646,7 +646,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only, #ifdef ENABLE_COLOR /* When doing syntax coloring, the replacement might require * a change of colors, so refresh the whole edit window. */ - if (openfile->syntax && !ISSET(NO_COLOR_SYNTAX)) + if (openfile->syntax && !ISSET(NO_SYNTAX)) edit_refresh(); else #endif diff --git a/src/winio.c b/src/winio.c index 8cd20f48..d792d2a6 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2421,8 +2421,8 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) #endif #ifdef ENABLE_COLOR - /* If color syntaxes are available and turned on, apply them. */ - if (openfile->syntax && !ISSET(NO_COLOR_SYNTAX)) { + /* If there are color rules (and coloring is turned on), apply them. */ + if (openfile->syntax && !ISSET(NO_SYNTAX)) { const colortype *varnish = openfile->syntax->color; /* If there are multiline regexes, make sure there is a cache. */ @@ -3259,7 +3259,7 @@ void edit_refresh(void) #ifdef ENABLE_COLOR /* When needed and useful, initialize the colors for the current syntax. */ - if (openfile->syntax && !have_palette && !ISSET(NO_COLOR_SYNTAX) && has_colors()) + if (openfile->syntax && !have_palette && !ISSET(NO_SYNTAX) && has_colors()) prepare_palette(); #endif