nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH 14/15] tweaks: switch from checking MORE_SPACE to ch


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH 14/15] tweaks: switch from checking MORE_SPACE to checking EMPTY_LINE
Date: Thu, 31 Jan 2019 19:14:49 +0100

---
 src/nano.c  |  7 +------
 src/winio.c | 10 +++++-----
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/nano.c b/src/nano.c
index 8b3ca603..9bb24acc 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -688,7 +688,7 @@ void window_init(void)
                edit = newwin(1, COLS, 0, 0);
                bottomwin = newwin(1, COLS, LINES - 1, 0);
        } else {
-               int toprows = (ISSET(MORE_SPACE) ? 1 : (LINES < 6) ? 1 : 2);
+               int toprows = (!ISSET(EMPTY_LINE) ? 1 : (LINES < 6) ? 1 : 2);
                int bottomrows = (ISSET(NO_HELP) ? 1 : (LINES < 5) ? 1 : 3);
 
                editwinrows = LINES - toprows - bottomrows;
@@ -2415,11 +2415,6 @@ int main(int argc, char **argv)
        }
 #endif /* ENABLE_NANORC */
 
-       if (ISSET(EMPTY_LINE))
-               UNSET(MORE_SPACE);
-       else
-               SET(MORE_SPACE);
-
        /* If the user wants bold instead of reverse video for hilited text... 
*/
        if (ISSET(BOLD_TEXT))
                hilite_attribute = A_BOLD;
diff --git a/src/winio.c b/src/winio.c
index 3979c2fc..bfe8eed0 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -3519,7 +3519,7 @@ void spotlight_softwrapped(size_t from_col, size_t to_col)
  * are FALSE. */
 void do_credits(void)
 {
-       bool old_more_space = ISSET(MORE_SPACE);
+       bool had_empty_line = ISSET(EMPTY_LINE);
        bool old_no_help = ISSET(NO_HELP);
        int kbinput = ERR, crpos = 0, xlpos = 0;
        const char *credits[CREDIT_LEN] = {
@@ -3591,8 +3591,8 @@ void do_credits(void)
                N_("Thank you for using nano!")
        };
 
-       if (!old_more_space || !old_no_help) {
-               SET(MORE_SPACE);
+       if (had_empty_line || !old_no_help) {
+               UNSET(EMPTY_LINE);
                SET(NO_HELP);
                window_init();
        }
@@ -3650,8 +3650,8 @@ void do_credits(void)
        if (kbinput != ERR)
                ungetch(kbinput);
 
-       if (!old_more_space)
-               UNSET(MORE_SPACE);
+       if (had_empty_line)
+               SET(EMPTY_LINE);
        if (!old_no_help)
                UNSET(NO_HELP);
        window_init();
-- 
2.19.2




reply via email to

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