diff --git a/ChangeLog b/ChangeLog index 7257842d..adeb4906 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ tweaks by me, add wnoutrefresh() calls after reset_(statusbar_)?cursor() calls, to ensure that the cursor is placed properly when using NetBSD curses. + * nano.c (disable_mouse_support, enable_mouse_support): When + toggling mouse support on or off, save and restore the mouse + click interval. 2007-11-29 Jean-Philippe Guérard diff --git a/src/nano.c b/src/nano.c index dd7ae315..483ee449 100644 --- a/src/nano.c +++ b/src/nano.c @@ -41,6 +41,10 @@ #include #endif +#ifndef DISABLE_MOUSE +static int oldinterval = -1; + /* Used to store the user's original mouse click interval. */ +#endif #ifdef ENABLE_NANORC static bool no_rcfiles = FALSE; /* Should we ignore all rcfiles? */ @@ -711,13 +715,14 @@ void window_init(void) void disable_mouse_support(void) { mousemask(0, NULL); + mouseinterval(oldinterval); } /* Enable mouse support. */ void enable_mouse_support(void) { mousemask(ALL_MOUSE_EVENTS, NULL); - mouseinterval(50); + oldinterval = mouseinterval(50); } /* Initialize mouse support. Enable it if the USE_MOUSE flag is set,