Mercurial > vim
comparison src/mouse.c @ 31194:fa26d002eb2a v9.0.0931
patch 9.0.0931: MS-Windows: mouse column limited to 223
Commit: https://github.com/vim/vim/commit/36446bbb62b466ce873c872b266a29bebbfc9890
Author: Christopher Plewright <chris@createng.com>
Date: Wed Nov 23 22:28:08 2022 +0000
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 23 Nov 2022 23:30:03 +0100 |
parents | a86ee6c0309e |
children | 4545f58c8490 |
comparison
equal
deleted
inserted
replaced
31193:4e0ce485ef64 | 31194:fa26d002eb2a |
---|---|
2306 * this avoids trouble with mouse clicks at an unexpected moment and | 2306 * this avoids trouble with mouse clicks at an unexpected moment and |
2307 * allows for mapping them. | 2307 * allows for mapping them. |
2308 */ | 2308 */ |
2309 for (;;) | 2309 for (;;) |
2310 { | 2310 { |
2311 # ifdef FEAT_GUI | 2311 // For the GUI and for MS-Windows two bytes each are used for row |
2312 if (gui.in_use) | 2312 // and column. Allows for more than 223 columns. |
2313 { | 2313 # if defined(FEAT_GUI) || defined(MSWIN) |
2314 // GUI uses more bits for columns > 223 | 2314 if (TRUE |
2315 # if defined(FEAT_GUI) && !defined(MSWIN) | |
2316 && gui.in_use | |
2317 # endif | |
2318 ) | |
2319 { | |
2315 num_bytes = get_bytes_from_buf(tp + *slen, bytes, 5); | 2320 num_bytes = get_bytes_from_buf(tp + *slen, bytes, 5); |
2316 if (num_bytes == -1) // not enough coordinates | 2321 if (num_bytes == -1) // not enough coordinates |
2317 return -1; | 2322 return -1; |
2318 mouse_code = bytes[0]; | 2323 mouse_code = bytes[0]; |
2319 mouse_col = 128 * (bytes[1] - ' ' - 1) | 2324 mouse_col = 128 * (bytes[1] - ' ' - 1) |