Commit 63c8ab94 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Tadaa. Keypad issue fixed. It was the stupid timeout(0) call. UGH

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@437 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 13 additions and 29 deletions
+13 -29
...@@ -78,6 +78,9 @@ ...@@ -78,6 +78,9 @@
favor of the last stored search (47) [FIXED] favor of the last stored search (47) [FIXED]
- If nano fails to open a file when it starts up,doing almost anything - If nano fails to open a file when it starts up,doing almost anything
causes a segfault (discovered by Ben Roberts) (48). [FIXED] 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 ** ** Open BUGS **
......
...@@ -5,6 +5,10 @@ General - ...@@ -5,6 +5,10 @@ General -
filestat(). New shortcut list browser_list. Some new filestat(). New shortcut list browser_list. Some new
strings to translate. Chris needs to add comments to his strings to translate. Chris needs to add comments to his
code. 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: - faq.html:
- Fix typos and small mistakes (Jordi). - Fix typos and small mistakes (Jordi).
- files.c: - files.c:
......
...@@ -1205,7 +1205,6 @@ char *do_browser(char *inpath) ...@@ -1205,7 +1205,6 @@ char *do_browser(char *inpath)
titlebar(path); titlebar(path);
bottombars(browser_list, BROWSER_LIST_LEN); bottombars(browser_list, BROWSER_LIST_LEN);
keypad_on(TRUE);
curs_set(0); curs_set(0);
wmove(edit, 0, 0); wmove(edit, 0, 0);
i = 0; i = 0;
......
...@@ -74,12 +74,6 @@ char *last_search = NULL; /* Last string we searched for */ ...@@ -74,12 +74,6 @@ char *last_search = NULL; /* Last string we searched for */
char *last_replace = NULL; /* Last replacement string */ char *last_replace = NULL; /* Last replacement string */
int search_last_line; /* Is this the last search line? */ 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 */ /* What we do when we're all set to exit */
RETSIGTYPE finish(int sigage) RETSIGTYPE finish(int sigage)
{ {
...@@ -89,10 +83,6 @@ RETSIGTYPE finish(int sigage) ...@@ -89,10 +83,6 @@ RETSIGTYPE finish(int sigage)
} else } else
mvwaddstr(bottomwin, 0, 0, hblank); 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); wrefresh(bottomwin);
endwin(); endwin();
...@@ -1649,6 +1639,10 @@ void window_init(void) ...@@ -1649,6 +1639,10 @@ void window_init(void)
/* And the other windows */ /* And the other windows */
topwin = newwin(2, COLS, 0, 0); topwin = newwin(2, COLS, 0, 0);
bottomwin = newwin(3 - no_help(), COLS, LINES - 3 + no_help(), 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) void mouse_init(void)
...@@ -1656,15 +1650,12 @@ void mouse_init(void) ...@@ -1656,15 +1650,12 @@ void mouse_init(void)
#ifndef NANO_SMALL #ifndef NANO_SMALL
#ifdef NCURSES_MOUSE_VERSION #ifdef NCURSES_MOUSE_VERSION
if (ISSET(USE_MOUSE)) { if (ISSET(USE_MOUSE)) {
keypad_on(TRUE);
mousemask(BUTTON1_RELEASED, NULL); mousemask(BUTTON1_RELEASED, NULL);
mouseinterval(50); mouseinterval(50);
} else { } else
mousemask(0, NULL); mousemask(0, NULL);
keypad_on(FALSE);
}
#endif #endif
#endif #endif
...@@ -2215,7 +2206,6 @@ int main(int argc, char *argv[]) ...@@ -2215,7 +2206,6 @@ int main(int argc, char *argv[])
nonl(); nonl();
cbreak(); cbreak();
noecho(); noecho();
timeout(0);
/* Set up some global variables */ /* Set up some global variables */
global_init(); global_init();
...@@ -2233,12 +2223,6 @@ int main(int argc, char *argv[]) ...@@ -2233,12 +2223,6 @@ int main(int argc, char *argv[])
window_init(); window_init();
mouse_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 #ifdef DEBUG
fprintf(stderr, _("Main: bottom win\n")); fprintf(stderr, _("Main: bottom win\n"));
#endif #endif
......
...@@ -138,7 +138,6 @@ void search_init_globals(void); ...@@ -138,7 +138,6 @@ void search_init_globals(void);
void replace_abort(void); void replace_abort(void);
void add_to_cutbuffer(filestruct * inptr); void add_to_cutbuffer(filestruct * inptr);
void do_replace_highlight(int highlight_flag, char *word); void do_replace_highlight(int highlight_flag, char *word);
void keypad_on(int yesno);
void nano_disabled_msg(void); void nano_disabled_msg(void);
#ifdef NANO_EXTRA #ifdef NANO_EXTRA
void do_credits(void); void do_credits(void);
......
...@@ -1183,11 +1183,6 @@ int do_help(void) ...@@ -1183,11 +1183,6 @@ int do_help(void)
int i, j, row = 0, page = 1, kbinput = 0, no_more = 0; int i, j, row = 0, page = 1, kbinput = 0, no_more = 0;
int no_help_flag = 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(); blank_edit();
curs_set(0); curs_set(0);
blank_statusbar(); blank_statusbar();
......
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