summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-04-04 21:53:11 +0200
committerBram Moolenaar <Bram@vim.org>2018-04-04 21:53:11 +0200
commit1f8495cf48888ff3a8ab3d0eb22db92389191a60 (patch)
tree828f1b7d464672c77dff99b9614d0a8f46c7755f /src/term.c
parent79cf7c0d4574f15cfad5ad706f175e226c528f2a (diff)
downloadvim-git-1f8495cf48888ff3a8ab3d0eb22db92389191a60.tar.gz
patch 8.0.1659: scroll events not recognized for some xterm emulatorsv8.0.1659
Problem: Scroll events not recognized for some xterm emulators. Solution: Recognize mouse codes 0x40 and 0x41 as scroll events.
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/term.c b/src/term.c
index c74e14f44..3a27fa691 100644
--- a/src/term.c
+++ b/src/term.c
@@ -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