1
0
forked from aniani/vim

patch 9.0.0931: MS-Windows: mouse column limited to 223

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)
This commit is contained in:
Christopher Plewright
2022-11-23 22:28:08 +00:00
committed by Bram Moolenaar
parent 63a2e360cc
commit 36446bbb62
4 changed files with 27 additions and 11 deletions

View File

@@ -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
{