commit 40639ddc0c120fb7a5c2217068dc6305256e81de
parent 309aa50fdaad12fc3c91124bff4464eba013df4a
Author: Chris Allegretta <chrisa@asty.org>
Date: Mon, 4 Mar 2002 12:25:34 +0000
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
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git 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
@@ -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);
}
}