commit 556c0a386516569497723974e4e08f52d31d1afc
parent 4d40bea58aae4dd14d4cd37fe470595934b0dca9
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 28 Jan 2019 19:55:04 +0100
rcfile: when an old flag is unset, set the corresponding new flag
This fixes https://savannah.gnu.org/bugs/?55583.
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -2407,6 +2407,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];