Letting the value of a --fill option on the command line
override the value of a "set fill" option in an rcfile. This fixes Savannah bug #46492. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5428 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
c9e8370cec
commit
1f027a838e
|
@ -1,3 +1,8 @@
|
||||||
|
2015-11-21 Benno Schulenberg <bensberg@justemail.net>
|
||||||
|
* src/nano.c (main): Let the value of a --fill option on the
|
||||||
|
command line override the value of a "set fill" in an rcfile.
|
||||||
|
This fixes Savannah bug #46492.
|
||||||
|
|
||||||
2015-11-21 David Lawrence Ramsey <pooka109@gmail.com>
|
2015-11-21 David Lawrence Ramsey <pooka109@gmail.com>
|
||||||
* ChangeLog, NEWS: Fix a typo and adjust some spacing.
|
* ChangeLog, NEWS: Fix a typo and adjust some spacing.
|
||||||
|
|
||||||
|
|
13
src/nano.c
13
src/nano.c
|
@ -2109,7 +2109,9 @@ int main(int argc, char **argv)
|
||||||
/* Target line and column when specified on the command line. */
|
/* Target line and column when specified on the command line. */
|
||||||
#ifndef DISABLE_WRAPJUSTIFY
|
#ifndef DISABLE_WRAPJUSTIFY
|
||||||
bool fill_used = FALSE;
|
bool fill_used = FALSE;
|
||||||
/* Was the fill option used? */
|
/* Was the fill option used on the command line? */
|
||||||
|
bool forced_wrapping = FALSE;
|
||||||
|
/* Should long lines be automatically hard wrapped? */
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_MULTIBUFFER
|
#ifndef DISABLE_MULTIBUFFER
|
||||||
bool old_multibuffer;
|
bool old_multibuffer;
|
||||||
|
@ -2382,6 +2384,7 @@ int main(int argc, char **argv)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
fill_used = TRUE;
|
fill_used = TRUE;
|
||||||
|
forced_wrapping = TRUE;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_SPELLER
|
#ifndef DISABLE_SPELLER
|
||||||
|
@ -2405,7 +2408,7 @@ int main(int argc, char **argv)
|
||||||
SET(NO_WRAP);
|
SET(NO_WRAP);
|
||||||
/* If both --fill and --nowrap are given on the
|
/* If both --fill and --nowrap are given on the
|
||||||
* command line, the last given option wins. */
|
* command line, the last given option wins. */
|
||||||
fill_used = FALSE;
|
forced_wrapping = FALSE;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 'x':
|
case 'x':
|
||||||
|
@ -2539,9 +2542,9 @@ int main(int argc, char **argv)
|
||||||
#endif /* !DISABLE_NANORC */
|
#endif /* !DISABLE_NANORC */
|
||||||
|
|
||||||
#ifndef DISABLE_WRAPPING
|
#ifndef DISABLE_WRAPPING
|
||||||
/* Override an rcfile "set nowrap" or --disable-wrapping-as-root
|
/* Override a "set nowrap" in an rcfile (or a --disable-wrapping-as-root)
|
||||||
* if a --fill option was given on the command line. */
|
* if --fill was given on the command line and not undone by --nowrap. */
|
||||||
if (fill_used)
|
if (forced_wrapping)
|
||||||
UNSET(NO_WRAP);
|
UNSET(NO_WRAP);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue