summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-22 22:37:57 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-22 22:37:57 +0200
commita529ce068ba84d53343f3732b6a1ed4ad1fe3a68 (patch)
treea427a438d7a02ba84e0aa8a980b59c047269e0e5 /src/os_unix.c
parenta1fed064d1eca6ae2c526311ec5464175c6f19e2 (diff)
downloadvim-git-a529ce068ba84d53343f3732b6a1ed4ad1fe3a68.tar.gz
patch 8.0.0661: recognizing urxvt mouse codes does not work wellv8.0.0661
Problem: Recognizing urxvt mouse codes does not work well. Solution: Recognize "Esc[*M" and "Esc[*m". (Maurice Bos, closes #1486)
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 8ed3a67f8..fbe550de9 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3771,7 +3771,6 @@ check_mouse_termcode(void)
del_mouse_termcode(KS_PTERM_MOUSE);
# endif
# ifdef FEAT_MOUSE_URXVT
- /* same conflict as the dec mouse */
if (use_xterm_mouse() == 3
# ifdef FEAT_GUI
&& !gui.in_use
@@ -3779,8 +3778,8 @@ check_mouse_termcode(void)
)
{
set_mouse_termcode(KS_URXVT_MOUSE, (char_u *)(term_is_8bit(T_NAME)
- ? IF_EB("\233", CSI_STR)
- : IF_EB("\033[", ESC_STR "[")));
+ ? IF_EB("\233*M", CSI_STR "*M")
+ : IF_EB("\033[*M", ESC_STR "[*M")));
if (*p_mouse != NUL)
{
@@ -3792,7 +3791,6 @@ check_mouse_termcode(void)
del_mouse_termcode(KS_URXVT_MOUSE);
# endif
# ifdef FEAT_MOUSE_SGR
- /* There is no conflict with xterm mouse */
if (use_xterm_mouse() == 4
# ifdef FEAT_GUI
&& !gui.in_use
@@ -3800,8 +3798,12 @@ check_mouse_termcode(void)
)
{
set_mouse_termcode(KS_SGR_MOUSE, (char_u *)(term_is_8bit(T_NAME)
- ? IF_EB("\233<", CSI_STR "<")
- : IF_EB("\033[<", ESC_STR "[<")));
+ ? IF_EB("\233<*M", CSI_STR "<*M")
+ : IF_EB("\033[<*M", ESC_STR "[<*M")));
+
+ set_mouse_termcode(KS_SGR_MOUSE_RELEASE, (char_u *)(term_is_8bit(T_NAME)
+ ? IF_EB("\233<*m", CSI_STR "<*m")
+ : IF_EB("\033[<*m", ESC_STR "[<*m")));
if (*p_mouse != NUL)
{
@@ -3810,7 +3812,10 @@ check_mouse_termcode(void)
}
}
else
+ {
del_mouse_termcode(KS_SGR_MOUSE);
+ del_mouse_termcode(KS_SGR_MOUSE_RELEASE);
+ }
# endif
}
#endif