]> granicus.if.org Git - vim/commitdiff
patch 8.0.1324: some xterm sends different mouse move codes v8.0.1324
authorBram Moolenaar <Bram@vim.org>
Mon, 20 Nov 2017 20:52:24 +0000 (21:52 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 20 Nov 2017 20:52:24 +0000 (21:52 +0100)
Problem:    Some xterm sends different mouse move codes.
Solution:   Also accept 0x80 as a move event.

src/term.c
src/version.c

index 359c17100d9f5ba27ebb438691966fbe382ec5d8..4e38bae5f9851bb0cbeb05402f4f0a6a0c284f1c 100644 (file)
@@ -4980,6 +4980,8 @@ check_termcode(
                 *      add 0x08 for ALT
                 *      add 0x10 for CTRL
                 *      add 0x20 for mouse drag (0x40 is drag with left button)
+                *      add 0x40 for mouse move (0x80 is move, 0x81 too)
+                *               0x43 (drag + release) is also move
                 *  c == column + ' ' + 1 == column + 33
                 *  r == row + ' ' + 1 == row + 33
                 *
@@ -5121,9 +5123,15 @@ check_termcode(
 #   endif
                        )
                {
-                   /* Keep the mouse_code before it's changed, so that we
-                    * remember that it was a mouse wheel click. */
-                   wheel_code = mouse_code;
+#   if defined(UNIX) && defined(FEAT_MOUSE_TTY)
+                   if (use_xterm_mouse() > 1 && mouse_code >= 0x80)
+                       /* mouse-move event, using MOUSE_DRAG works */
+                       mouse_code = MOUSE_DRAG;
+                   else
+#   endif
+                       /* Keep the mouse_code before it's changed, so that we
+                        * remember that it was a mouse wheel click. */
+                       wheel_code = mouse_code;
                }
 #   ifdef FEAT_MOUSE_XTERM
                else if (held_button == MOUSE_RELEASE
index bbb57659496c37bea45d57a244e9b9ed280989f9..4f9fc87b17a8a94db4f802808be49efb1b06388a 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1324,
 /**/
     1323,
 /**/