1
1

tweaks: transform the token DISABLE_WRAPJUSTIFY to ENABLED_WRAPORJUSTIFY

Этот коммит содержится в:
Benno Schulenberg 2017-10-31 17:39:30 +01:00
родитель db0b849f9b
Коммит f034992ed6
6 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -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"),

Просмотреть файл

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