[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
- [Nano-devel] [PATCH 04/15] options: add -e, --emptyline, the counterpart of --morespace, (continued)
- [Nano-devel] [PATCH 04/15] options: add -e, --emptyline, the counterpart of --morespace, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 05/15] rcfile: add the options that correspond to -b, -f, -j, and -e, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 06/15] options: when a nanorc unsets an old flag, set the corresponding new flag, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 07/15] options: let --fill no longer imply automatic hard-wrapping, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 08/15] docs: stop saying that --fill switches on automatic hard-wrapping, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 09/15] docs: describe the four new options (-b, -f, -j, -e) [*incomplete*], Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 10/15] options: warn when -L, -O, -S, or -w are given, and ignore them, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 11/15] tweaks: switch from referencing NO_WRAP to referencing BREAK_LONG_LINES, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 12/15] tweaks: switch from referencing NO_NEWLINES to referencing FINAL_NEWLINE, Benno Schulenberg, 2019/01/31