[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nano-devel
Subject:    [Nano-devel] [PATCH 06/15] options: when a nanorc unsets an old flag, set the corresponding new flag
From:       Benno Schulenberg <bensberg () telfort ! nl>
Date:       2019-01-31 16:49:32
Message-ID: 20190131164941.14074-6-bensberg () telfort ! nl
[Download RAW message or body]

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 mailing list
Nano-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/nano-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic