nano-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]