From f034992ed6a645d1d3f1658d5a0986e58dcc4e9a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 31 Oct 2017 17:39:30 +0100 Subject: [PATCH] tweaks: transform the token DISABLE_WRAPJUSTIFY to ENABLED_WRAPORJUSTIFY --- src/global.c | 2 +- src/nano.c | 14 +++++++------- src/nano.h | 4 ++-- src/proto.h | 4 ++-- src/rcfile.c | 4 ++-- src/text.c | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/global.c b/src/global.c index 182cf567..e6f3acdf 100644 --- a/src/global.c +++ b/src/global.c @@ -84,7 +84,7 @@ int altleft, altright, altup, altdown; int shiftaltleft, shiftaltright, shiftaltup, shiftaltdown; #endif -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY ssize_t fill = 0; /* The column where we will wrap lines. */ ssize_t wrap_at = -CHARS_FROM_EOL; diff --git a/src/nano.c b/src/nano.c index ac6e623b..4ac48c6f 100644 --- a/src/nano.c +++ b/src/nano.c @@ -721,7 +721,7 @@ void window_init(void) keypad(bottomwin, TRUE); } -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY /* Set up the wrapping point, accounting for screen width when negative. */ fill = wrap_at; if (fill <= 0) @@ -885,7 +885,7 @@ void usage(void) print_opt("-q", "--quiet", N_("Silently ignore startup issues like rc file errors")); #endif -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY print_opt(_("-r <#cols>"), _("--fill=<#cols>"), N_("Set hard-wrapping point at column #cols")); #endif @@ -1893,7 +1893,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls) int main(int argc, char **argv) { int optchr; -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY bool fill_used = FALSE; /* Was the fill option used on the command line? */ #ifdef ENABLE_WRAPPING @@ -1945,7 +1945,7 @@ int main(int argc, char **argv) #endif {"preserve", 0, NULL, 'p'}, {"quiet", 0, NULL, 'q'}, -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY {"fill", 1, NULL, 'r'}, #endif #ifndef DISABLE_SPELLER @@ -2170,7 +2170,7 @@ int main(int argc, char **argv) SET(QUIET); break; #endif -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY case 'r': if (!parse_num(optarg, &wrap_at)) { fprintf(stderr, _("Requested fill size \"%s\" is invalid"), optarg); @@ -2255,7 +2255,7 @@ int main(int argc, char **argv) #ifdef ENABLE_OPERATINGDIR char *operating_dir_cpy = operating_dir; #endif -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY ssize_t wrap_at_cpy = wrap_at; #endif #ifndef NANO_TINY @@ -2302,7 +2302,7 @@ int main(int argc, char **argv) operating_dir = operating_dir_cpy; } #endif -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY if (fill_used) wrap_at = wrap_at_cpy; #endif diff --git a/src/nano.h b/src/nano.h index 59bf933c..f47b7679 100644 --- a/src/nano.h +++ b/src/nano.h @@ -128,8 +128,8 @@ #undef ENABLE_MOUSE #endif -#if !defined(ENABLE_WRAPPING) && !defined(ENABLE_JUSTIFY) -#define DISABLE_WRAPJUSTIFY 1 +#if defined(ENABLE_WRAPPING) || defined(ENABLE_JUSTIFY) +#define ENABLED_WRAPORJUSTIFY 1 #endif #define BACKWARD FALSE diff --git a/src/proto.h b/src/proto.h index 8b8d4aea..e830b4f5 100644 --- a/src/proto.h +++ b/src/proto.h @@ -83,7 +83,7 @@ extern int shiftaltup; extern int shiftaltdown; #endif -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY extern ssize_t fill; extern ssize_t wrap_at; #endif @@ -551,7 +551,7 @@ void update_undo(undo_type action); void wrap_reset(void); bool do_wrap(filestruct *line); #endif -#if defined(ENABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY) +#if defined(ENABLE_HELP) || defined(ENABLED_WRAPORJUSTIFY) ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl); #endif #if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY) diff --git a/src/rcfile.c b/src/rcfile.c index e57dad9c..68ca5f0f 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -44,7 +44,7 @@ static const rcoption rcopts[] = { #endif {"const", CONSTANT_SHOW}, /* deprecated form, remove in 2018 */ {"constantshow", CONSTANT_SHOW}, -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY {"fill", 0}, #endif #ifdef ENABLE_HISTORIES @@ -1106,7 +1106,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only) operating_dir = option; else #endif -#ifndef DISABLE_WRAPJUSTIFY +#ifdef ENABLED_WRAPORJUSTIFY if (strcasecmp(rcopts[i].name, "fill") == 0) { if (!parse_num(option, &wrap_at)) { rcfile_error(N_("Requested fill size \"%s\" is invalid"), diff --git a/src/text.c b/src/text.c index 891b5710..d5be0675 100644 --- a/src/text.c +++ b/src/text.c @@ -1668,7 +1668,7 @@ bool do_wrap(filestruct *line) } #endif /* ENABLE_WRAPPING */ -#if defined(ENABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY) +#if defined(ENABLE_HELP) || defined(ENABLED_WRAPORJUSTIFY) /* We are trying to break a chunk off line. We find the last blank such * that the display length to there is at most (goal + 1). If there is * no such blank, then we find the first blank. We then take the last @@ -1740,7 +1740,7 @@ ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl) return lastblank; } -#endif /* ENABLE_HELP || !DISABLE_WRAPJUSTIFY */ +#endif /* ENABLE_HELP || ENABLED_WRAPORJUSTIFY */ #if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY) /* The "indentation" of a line is the whitespace between the quote part