diff --git a/ChangeLog b/ChangeLog index 86ed8153f764307893b38743bf745fc61bb8b2dc..0478b64f7c2b66b6e71d7aa9a2b9d20f7efac8d7 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 d2a69798dfb9572d763ae26f15b14c2e3a92f7d2..d12f99bcc4e14a3e615a16c44b33e91fcc37f336 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); } }