summaryrefslogtreecommitdiffstats
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorChristopher Plewright <chris@createng.com>2022-11-23 22:28:08 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-23 22:28:08 +0000
commit36446bbb62b466ce873c872b266a29bebbfc9890 (patch)
tree456dfaa075f21860ee5e07917a6a643d91e3261e /src/os_win32.c
parent63a2e360cca2c70ab0a85d14771d3259d4b3aafa (diff)
patch 9.0.0931: MS-Windows: mouse column limited to 223v9.0.0931
Problem: MS-Windows: mouse column limited to 223. Solution: Use two bytes for each mouse coordinate. Add the mouse position to scroll events. (Christopher Plewright, closes #11597)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index ead50e186a..4c97b31002 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2055,17 +2055,23 @@ mch_inchar(
typeahead[typeaheadlen++] = CSI;
typeahead[typeaheadlen++] = KS_EXTRA;
typeahead[typeaheadlen++] = scroll_dir;
- g_nMouseClick = -1;
}
else
{
typeahead[typeaheadlen++] = ESC + 128;
typeahead[typeaheadlen++] = 'M';
typeahead[typeaheadlen++] = g_nMouseClick;
- typeahead[typeaheadlen++] = g_xMouse + '!';
- typeahead[typeaheadlen++] = g_yMouse + '!';
- g_nMouseClick = -1;
}
+
+ // Pass the pointer coordinates of the mouse event in 2 bytes,
+ // allowing for > 223 columns. Both for click and scroll events.
+ // This is the same as what is used for the GUI.
+ typeahead[typeaheadlen++] = (char_u)(g_xMouse / 128 + ' ' + 1);
+ typeahead[typeaheadlen++] = (char_u)(g_xMouse % 128 + ' ' + 1);
+ typeahead[typeaheadlen++] = (char_u)(g_yMouse / 128 + ' ' + 1);
+ typeahead[typeaheadlen++] = (char_u)(g_yMouse % 128 + ' ' + 1);
+
+ g_nMouseClick = -1;
}
else
{