diff --git a/BUGS b/BUGS index 1adfbcded4eddab2693030e39714bc0dda7bc31a..b33517630a7839b14fc1f53a99c8b62978eff038 100644 --- a/BUGS +++ b/BUGS @@ -78,6 +78,9 @@ favor of the last stored search (47) [FIXED] - If nano fails to open a file when it starts up,doing almost anything causes a segfault (discovered by Ben Roberts) (48). [FIXED] +- In certain terminals, nano would not work properly with keypad(). + Turned out to be the silly timeout(0) call which is completely + unneeded anyway. (49) [FIXED] ** Open BUGS ** diff --git a/ChangeLog b/ChangeLog index 2389c71dadd730f1eadb5a6a614a6670fcaa4eb7..894978df07a8b290f3fcb06ac3499ea3822c8cfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ General - filestat(). New shortcut list browser_list. Some new strings to translate. Chris needs to add comments to his code. + - We only call keypad() once now for each window, at the beginning. + FINALLY! No more keypad_on(), no more individual calls in + main(), do_help(), do_browser(), etc etc etc. Removed call to + timeout(0) in main() (which caused the whole mess), fixes BUG #49. - faq.html: - Fix typos and small mistakes (Jordi). - files.c: diff --git a/files.c b/files.c index db496e5305e14bec567b953b94fd98e7709345a4..90872778ff6b003213725a53f6321b035f6a1d69 100644 --- a/files.c +++ b/files.c @@ -1205,7 +1205,6 @@ char *do_browser(char *inpath) titlebar(path); bottombars(browser_list, BROWSER_LIST_LEN); - keypad_on(TRUE); curs_set(0); wmove(edit, 0, 0); i = 0; diff --git a/nano.c b/nano.c index 53daa177949af3e7d7df8375e196bcd437af7da9..0dd177260e1d36be0be7f6eef6e14816baec0427 100644 --- a/nano.c +++ b/nano.c @@ -74,12 +74,6 @@ char *last_search = NULL; /* Last string we searched for */ char *last_replace = NULL; /* Last replacement string */ int search_last_line; /* Is this the last search line? */ -void keypad_on(int yesno) -{ - keypad(edit, yesno); - keypad(bottomwin, yesno); -} - /* What we do when we're all set to exit */ RETSIGTYPE finish(int sigage) { @@ -89,10 +83,6 @@ RETSIGTYPE finish(int sigage) } else mvwaddstr(bottomwin, 0, 0, hblank); - /* Apparently you REALLY can't get away with not calling keypad() - or your window looks awful when it exits. so we just call it right - before we exit, muhaha :-) */ - keypad_on(TRUE); wrefresh(bottomwin); endwin(); @@ -1649,6 +1639,10 @@ void window_init(void) /* And the other windows */ topwin = newwin(2, COLS, 0, 0); bottomwin = newwin(3 - no_help(), COLS, LINES - 3 + no_help(), 0); + + /* HAHA! Only do this once! */ + keypad(edit, TRUE); + keypad(bottomwin, TRUE); } void mouse_init(void) @@ -1656,15 +1650,12 @@ void mouse_init(void) #ifndef NANO_SMALL #ifdef NCURSES_MOUSE_VERSION if (ISSET(USE_MOUSE)) { - keypad_on(TRUE); - mousemask(BUTTON1_RELEASED, NULL); mouseinterval(50); - } else { + } else mousemask(0, NULL); - keypad_on(FALSE); - } + #endif #endif @@ -2215,7 +2206,6 @@ int main(int argc, char *argv[]) nonl(); cbreak(); noecho(); - timeout(0); /* Set up some global variables */ global_init(); @@ -2233,12 +2223,6 @@ int main(int argc, char *argv[]) window_init(); mouse_init(); -#ifdef PDCURSES - /* Must have this for the arrow, et al, keys to even work in - PDCurses+cygwin under Windows */ - keypad_on(TRUE); -#endif - #ifdef DEBUG fprintf(stderr, _("Main: bottom win\n")); #endif diff --git a/proto.h b/proto.h index 84d822f0996c34aeca06b242ee0910e02e216fb0..ed630a8dcdd12415057e2f2b937115d85c96890a 100644 --- a/proto.h +++ b/proto.h @@ -138,7 +138,6 @@ void search_init_globals(void); void replace_abort(void); void add_to_cutbuffer(filestruct * inptr); void do_replace_highlight(int highlight_flag, char *word); -void keypad_on(int yesno); void nano_disabled_msg(void); #ifdef NANO_EXTRA void do_credits(void); diff --git a/winio.c b/winio.c index fbc840fb0bf4d726b92c0eaacf3cf53db2043773..2276f6e536eab42f45f9c9a6073ac6fa5e58b1c9 100644 --- a/winio.c +++ b/winio.c @@ -1183,11 +1183,6 @@ int do_help(void) int i, j, row = 0, page = 1, kbinput = 0, no_more = 0; int no_help_flag = 0; - - /* Oh well, they've asked for the help menu, if the keypad is not on now - we're going to have to turn it on */ - keypad_on(TRUE); - blank_edit(); curs_set(0); blank_statusbar();