Fixed broken mouse handling with new shortcut setup

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1095 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2002-03-04 12:25:34 +00:00
parent 309aa50fda
commit 40639ddc0c
2 changed files with 6 additions and 5 deletions

View File

@ -11,7 +11,6 @@ CVS code -
- Removed stupid static definitions of toggles and shortcut - Removed stupid static definitions of toggles and shortcut
lists. Many changes to shortcut_init(), toggle_init(), lists. Many changes to shortcut_init(), toggle_init(),
statusq(), nanogetstr(), main(), and many other places. statusq(), nanogetstr(), main(), and many other places.
FIXME: Mouse support broken by this change.
- Multibuffer mode now allows multiple empty filenames. - Multibuffer mode now allows multiple empty filenames.
Changes to add_open_files(), removed open_file_dup_search(), Changes to add_open_files(), removed open_file_dup_search(),
open_file_dup_fix(), etc (DLR). open_file_dup_fix(), etc (DLR).

10
nano.c
View File

@ -1849,6 +1849,7 @@ void do_mouse(void)
MEVENT mevent; MEVENT mevent;
int foo = 0, tab_found = 0; int foo = 0, tab_found = 0;
int currslen; int currslen;
shortcut *s = currshortcut;
if (getmouse(&mevent) == ERR) if (getmouse(&mevent) == ERR)
return; return;
@ -1918,7 +1919,7 @@ void do_mouse(void)
edit_refresh(); edit_refresh();
} else if (wenclose(bottomwin, mevent.y, mevent.x) && !ISSET(NO_HELP)) { } else if (wenclose(bottomwin, mevent.y, mevent.x) && !ISSET(NO_HELP)) {
int k, val = 0; int i, k;
if (currshortcut == main_list) if (currshortcut == main_list)
currslen = MAIN_VISIBLE; currslen = MAIN_VISIBLE;
@ -1940,14 +1941,15 @@ void do_mouse(void)
if (mevent.x / k >= currslen) if (mevent.x / k >= currslen)
return; return;
val = currshortcut[(mevent.x / k) * 2 + mevent.y].val; for (i = 0; i < (mevent.x / k) * 2 + mevent.y; i++)
s = s->next;
/* And ungetch that value */ /* And ungetch that value */
ungetch(val); ungetch(s->val);
/* And if it's an alt-key sequence, we should probably send alt /* And if it's an alt-key sequence, we should probably send alt
too ;-) */ too ;-) */
if (val >= 'a' && val <= 'z') if (s->val >= 'a' && s->val <= 'z')
ungetch(27); ungetch(27);
} }
} }