[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] [PATCH 06/15] options: when a nanorc unsets an old flag, se
From: |
Benno Schulenberg |
Subject: |
[Nano-devel] [PATCH 06/15] options: when a nanorc unsets an old flag, set the corresponding new flag |
Date: |
Thu, 31 Jan 2019 17:49:32 +0100 |
This fixes https://savannah.gnu.org/bugs/?55583.
---
src/nano.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/nano.c b/src/nano.c
index accaf2d4..6be5932c 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2398,6 +2398,16 @@ int main(int argc, char **argv)
if (tabsize_cmdline != -1)
tabsize = tabsize_cmdline;
+ /* If an rcfile undid the default settings, copy it to the new
flags. */
+ if (!ISSET(NO_WRAP))
+ SET(BREAK_LONG_LINES);
+ if (!ISSET(NO_NEWLINES))
+ SET(FINAL_NEWLINE);
+ if (!ISSET(SMOOTH_SCROLL))
+ SET(JUMPY_SCROLLING);
+ if (!ISSET(MORE_SPACE))
+ SET(EMPTY_LINE);
+
/* Simply OR the boolean flags from rcfile and command line. */
for (size_t i = 0; i < sizeof(flags) / sizeof(flags[0]); i++)
flags[i] |= flags_cmdline[i];
--
2.19.2
- [Nano-devel] [PATCH 01/15] options: add -b, --breaklonglines, the counterpart of --nowrap, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 02/15] options: add -f, --finalnewline, the counterpart of --nonewlines, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 03/15] options: add -j, --jumpyscrolling, the counterpart of --smooth, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 04/15] options: add -e, --emptyline, the counterpart of --morespace, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 05/15] rcfile: add the options that correspond to -b, -f, -j, and -e, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 06/15] options: when a nanorc unsets an old flag, set the corresponding new flag,
Benno Schulenberg <=
- [Nano-devel] [PATCH 07/15] options: let --fill no longer imply automatic hard-wrapping, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 08/15] docs: stop saying that --fill switches on automatic hard-wrapping, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 09/15] docs: describe the four new options (-b, -f, -j, -e) [*incomplete*], Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 10/15] options: warn when -L, -O, -S, or -w are given, and ignore them, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 11/15] tweaks: switch from referencing NO_WRAP to referencing BREAK_LONG_LINES, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 12/15] tweaks: switch from referencing NO_NEWLINES to referencing FINAL_NEWLINE, Benno Schulenberg, 2019/01/31