commit 420fe4d1e6cdbae3a8712a3a90dc947ac9285d48
parent 322a6f46fa2de5b98ce7121206a0d4bb8fa61ecf
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 29 Jan 2019 20:46:37 +0100
tweaks: switch from checking MORE_SPACE to checking EMPTY_LINE
Diffstat:
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git 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;
@@ -2422,11 +2422,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
@@ -3526,7 +3526,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] = {
@@ -3598,8 +3598,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();
}
@@ -3657,8 +3657,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();