From 556c0a386516569497723974e4e08f52d31d1afc Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 28 Jan 2019 19:55:04 +0100 Subject: [PATCH] rcfile: when an old flag is unset, set the corresponding new flag 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 243e4f2c..9f614907 100644 --- 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];