Since the urxvt mouse handling was added, certain actions in Vim would
cause the mouse to get disabled even all the setting still indicated
it should be enabled. When running Vim in xterm,
check_mouse_termcode() calls set_mouse_termcode(KS_MOUSE, ...) to
enable xterm handling as well as del_mouse_termcode(KS_URXVT_MOUSE,
...) to turn off URXVT handling. However, since del_mouse_termcode()
doesn't handle URXVT specifically that had the effect of disabling
KS_MOUSE, effectively setting has_mouse_termcode to 0. So, any later
action which would have cause to temporarily disable the mouse (e.g.,
the warning message when starting to edit a read-only file or using
<C-z> to background Vim) would not know to re-enable the mouse since
setmouse() returns early if has_mouse_termcode is 0.
Attached patch adds the URXVT handling to set/del_mouse_termcode.
Cheers,
--
James
GPG Key: 1024D/61326D40 2003-09-02 James McCoy <[email protected]>
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff --git a/src/term.c b/src/term.c
--- a/src/term.c
+++ b/src/term.c
@@ -1996,6 +1996,7 @@
# define HMT_DEC 4
# define HMT_JSBTERM 8
# define HMT_PTERM 16
+# define HMT_URXVT 32
static int has_mouse_termcode = 0;
# endif
@@ -2031,6 +2032,11 @@
has_mouse_termcode |= HMT_PTERM;
else
# endif
+# ifdef FEAT_MOUSE_URXVT
+ if (n == KS_URXVT_MOUSE)
+ has_mouse_termcode |= HMT_URXVT;
+ else
+# endif
has_mouse_termcode |= HMT_NORMAL;
# endif
}
@@ -2068,6 +2074,11 @@
has_mouse_termcode &= ~HMT_PTERM;
else
# endif
+# ifdef FEAT_MOUSE_URXVT
+ if (n == KS_URXVT_MOUSE)
+ has_mouse_termcode &= ~HMT_URXVT;
+ else
+# endif
has_mouse_termcode &= ~HMT_NORMAL;
# endif
}