Commit 31de105e authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

turn the keypad on in topwin again, and clean up do_credits() a bit

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2989 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 33 additions and 8 deletions
+33 -8
...@@ -118,10 +118,11 @@ CVS code - ...@@ -118,10 +118,11 @@ CVS code -
new_magicline(), remove_magicline(), and do_cursorpos(). (DLR) new_magicline(), remove_magicline(), and do_cursorpos(). (DLR)
- Various fill-related cleanups. Move check_die_too_small() and - Various fill-related cleanups. Move check_die_too_small() and
window_size_init()'s code into window_init(), as they really window_size_init()'s code into window_init(), as they really
belong there, remove associated separate calls to them, and belong there, remove associated separate calls to them, make
make sure window_init() is always called at the same time when sure window_init() is always called at the same time when
redrawing the screen. Changes to window_init(), main(), and redrawing the screen, and turn the keypad on in topwin in case
do_alt_speller(); removal of check_die_too_small() and we ever read input from it. Changes to window_init(), main(),
and do_alt_speller(); removal of check_die_too_small() and
window_size_init(). (DLR) window_size_init(). (DLR)
- Remove still more redundant screen updates. Change all - Remove still more redundant screen updates. Change all
wrefresh() calls to wnoutrefresh() calls, except for those in wrefresh() calls to wnoutrefresh() calls, except for those in
...@@ -322,6 +323,12 @@ CVS code - ...@@ -322,6 +323,12 @@ CVS code -
that there's more room for other things, and to not display that there's more room for other things, and to not display
the status when we're in the file browser, since Pico doesn't. the status when we're in the file browser, since Pico doesn't.
(DLR) (DLR)
do_credits()
- Various cleanups. Turn on the MORE_SPACE and NO_HELP flags
before showing the credits, so that they use as much of the
screen as possible, and set the flags back to their original
values afterward. Also, only call scrollok() just before and
after we scroll. (DLR)
- configure.ac: - configure.ac:
- Since we only use vsnprintf() now, remove the tests for - Since we only use vsnprintf() now, remove the tests for
snprintf(). (DLR) snprintf(). (DLR)
......
...@@ -648,9 +648,9 @@ void window_init(void) ...@@ -648,9 +648,9 @@ void window_init(void)
bottomwin = newwin(3 - no_help(), COLS, editwinrows + (2 - bottomwin = newwin(3 - no_help(), COLS, editwinrows + (2 -
no_more_space()), 0); no_more_space()), 0);
/* Turn the keypad on for the windows that get input, if /* Turn the keypad on for the windows, if necessary. */
* necessary. */
if (!ISSET(REBIND_KEYPAD)) { if (!ISSET(REBIND_KEYPAD)) {
keypad(topwin, TRUE);
keypad(edit, TRUE); keypad(edit, TRUE);
keypad(bottomwin, TRUE); keypad(bottomwin, TRUE);
} }
......
...@@ -4185,6 +4185,8 @@ void dump_filestruct_reverse(void) ...@@ -4185,6 +4185,8 @@ void dump_filestruct_reverse(void)
/* Easter egg: Display credits. Assume nodelay(edit) is FALSE. */ /* Easter egg: Display credits. Assume nodelay(edit) is FALSE. */
void do_credits(void) void do_credits(void)
{ {
bool old_more_space = ISSET(MORE_SPACE);
bool old_no_help = ISSET(NO_HELP);
int kbinput = ERR, crpos = 0, xlpos = 0; int kbinput = ERR, crpos = 0, xlpos = 0;
const char *credits[CREDIT_LEN] = { const char *credits[CREDIT_LEN] = {
NULL, /* "The nano text editor" */ NULL, /* "The nano text editor" */
...@@ -4262,9 +4264,15 @@ void do_credits(void) ...@@ -4262,9 +4264,15 @@ void do_credits(void)
#endif #endif
"Florian K\xF6nig"; "Florian K\xF6nig";
if (!old_more_space || !old_no_help) {
SET(MORE_SPACE);
SET(NO_HELP);
window_init();
}
curs_set(0); curs_set(0);
nodelay(edit, TRUE); nodelay(edit, TRUE);
scrollok(edit, TRUE);
blank_titlebar(); blank_titlebar();
blank_topbar(); blank_topbar();
blank_edit(); blank_edit();
...@@ -4296,21 +4304,31 @@ void do_credits(void) ...@@ -4296,21 +4304,31 @@ void do_credits(void)
} }
napms(700); napms(700);
scrollok(edit, TRUE);
scroll(edit); scroll(edit);
scrollok(edit, FALSE);
wrefresh(edit); wrefresh(edit);
if ((kbinput = wgetch(edit)) != ERR) if ((kbinput = wgetch(edit)) != ERR)
break; break;
napms(700); napms(700);
scrollok(edit, TRUE);
scroll(edit); scroll(edit);
scrollok(edit, FALSE);
wrefresh(edit); wrefresh(edit);
} }
if (kbinput != ERR) if (kbinput != ERR)
ungetch(kbinput); ungetch(kbinput);
if (!old_more_space || !old_no_help) {
UNSET(MORE_SPACE);
UNSET(NO_HELP);
window_init();
}
curs_set(1); curs_set(1);
scrollok(edit, FALSE);
nodelay(edit, FALSE); nodelay(edit, FALSE);
total_refresh(); total_refresh();
} }
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment