]> granicus.if.org Git - vim/commitdiff
patch 8.0.1659: scroll events not recognized for some xterm emulators v8.0.1659
authorBram Moolenaar <Bram@vim.org>
Wed, 4 Apr 2018 19:53:11 +0000 (21:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 4 Apr 2018 19:53:11 +0000 (21:53 +0200)
Problem:    Scroll events not recognized for some xterm emulators.
Solution:   Recognize mouse codes 0x40 and 0x41 as scroll events.

src/term.c
src/version.c

index c74e14f44ba18b08e10a724e6e507444d2849286..3a27fa691d77ca6526029553e60cda5435d4590e 100644 (file)
@@ -5195,10 +5195,13 @@ check_termcode(
 #    ifdef FEAT_GUI
                        && !gui.in_use
 #    endif
-                       && (mouse_code == 0x23 || mouse_code == 0x24))
+                       && (mouse_code == 0x23 || mouse_code == 0x24
+                           || mouse_code == 0x40 || mouse_code == 0x41))
                {
-                   /* Apparently used by rxvt scroll wheel. */
-                   wheel_code = mouse_code - 0x23 + MOUSEWHEEL_LOW;
+                   /* Apparently 0x23 and 0x24 are used by rxvt scroll wheel.
+                    * And 0x40 and 0x41 are used by some xterm emulator. */
+                   wheel_code = mouse_code - (mouse_code >= 0x40 ? 0x40 : 0x23)
+                                                             + MOUSEWHEEL_LOW;
                }
 #   endif
 
index ac06f387a4cd720f27b63cc52e64bc9a6158b7d3..cdd8b418de172c84ccbcf68120e50d5dd265ac30 100644 (file)
@@ -762,6 +762,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1659,
 /**/
     1658,
 /**/