1
1

tweaks: switch from checking MORE_SPACE to checking EMPTY_LINE

Этот коммит содержится в:
Benno Schulenberg 2019-01-29 20:46:37 +01:00
родитель 322a6f46fa
Коммит 420fe4d1e6
2 изменённых файлов: 6 добавлений и 11 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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();