From: Chris Allegretta Date: Mon, 4 Mar 2002 12:25:34 +0000 (+0000) Subject: Fixed broken mouse handling with new shortcut setup X-Git-Tag: v1.1.7~10 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=40639ddc0c120fb7a5c2217068dc6305256e81de;p=nano.git 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 --- diff --git a/ChangeLog b/ChangeLog index 86ed8153..0478b64f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,7 +11,6 @@ CVS code - - Removed stupid static definitions of toggles and shortcut lists. Many changes to shortcut_init(), toggle_init(), statusq(), nanogetstr(), main(), and many other places. - FIXME: Mouse support broken by this change. - Multibuffer mode now allows multiple empty filenames. Changes to add_open_files(), removed open_file_dup_search(), open_file_dup_fix(), etc (DLR). diff --git a/nano.c b/nano.c index d2a69798..d12f99bc 100644 --- a/nano.c +++ b/nano.c @@ -1849,6 +1849,7 @@ void do_mouse(void) MEVENT mevent; int foo = 0, tab_found = 0; int currslen; + shortcut *s = currshortcut; if (getmouse(&mevent) == ERR) return; @@ -1918,7 +1919,7 @@ void do_mouse(void) edit_refresh(); } else if (wenclose(bottomwin, mevent.y, mevent.x) && !ISSET(NO_HELP)) { - int k, val = 0; + int i, k; if (currshortcut == main_list) currslen = MAIN_VISIBLE; @@ -1940,14 +1941,15 @@ void do_mouse(void) if (mevent.x / k >= currslen) 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 */ - ungetch(val); + ungetch(s->val); /* And if it's an alt-key sequence, we should probably send alt too ;-) */ - if (val >= 'a' && val <= 'z') + if (s->val >= 'a' && s->val <= 'z') ungetch(27); } }