Mercurial > vim
comparison src/term.c @ 24850:f8906bd5b277 v8.2.2963
patch 8.2.2963: GUI: mouse move may start Visual mode with a popup visible
Commit: https://github.com/vim/vim/commit/445f11d5bcfddfa194ebd12b029228c7e957f94c
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 8 20:13:31 2021 +0200
patch 8.2.2963: GUI: mouse move may start Visual mode with a popup visible
Problem: GUI: mouse move may start Visual mode with a popup visible.
Solution: Add special code for mouse move. (closes https://github.com/vim/vim/issues/8318)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 08 Jun 2021 20:15:05 +0200 |
parents | 7334bf933510 |
children | 2aefea114696 |
comparison
equal
deleted
inserted
replaced
24849:a63c6581af98 | 24850:f8906bd5b277 |
---|---|
5586 */ | 5586 */ |
5587 if (gui.in_use | 5587 if (gui.in_use |
5588 && key_name[0] == (int)KS_EXTRA | 5588 && key_name[0] == (int)KS_EXTRA |
5589 && (key_name[1] == (int)KE_X1MOUSE | 5589 && (key_name[1] == (int)KE_X1MOUSE |
5590 || key_name[1] == (int)KE_X2MOUSE | 5590 || key_name[1] == (int)KE_X2MOUSE |
5591 || key_name[1] == (int)KE_MOUSEMOVE_XY | |
5591 || key_name[1] == (int)KE_MOUSELEFT | 5592 || key_name[1] == (int)KE_MOUSELEFT |
5592 || key_name[1] == (int)KE_MOUSERIGHT | 5593 || key_name[1] == (int)KE_MOUSERIGHT |
5593 || key_name[1] == (int)KE_MOUSEDOWN | 5594 || key_name[1] == (int)KE_MOUSEDOWN |
5594 || key_name[1] == (int)KE_MOUSEUP)) | 5595 || key_name[1] == (int)KE_MOUSEUP)) |
5595 { | 5596 { |
5599 if (num_bytes == -1) // not enough coordinates | 5600 if (num_bytes == -1) // not enough coordinates |
5600 return -1; | 5601 return -1; |
5601 mouse_col = 128 * (bytes[0] - ' ' - 1) + bytes[1] - ' ' - 1; | 5602 mouse_col = 128 * (bytes[0] - ' ' - 1) + bytes[1] - ' ' - 1; |
5602 mouse_row = 128 * (bytes[2] - ' ' - 1) + bytes[3] - ' ' - 1; | 5603 mouse_row = 128 * (bytes[2] - ' ' - 1) + bytes[3] - ' ' - 1; |
5603 slen += num_bytes; | 5604 slen += num_bytes; |
5605 // equal to K_MOUSEMOVE | |
5606 if (key_name[1] == (int)KE_MOUSEMOVE_XY) | |
5607 key_name[1] = (int)KE_MOUSEMOVE; | |
5604 } | 5608 } |
5605 else | 5609 else |
5606 #endif | 5610 #endif |
5607 /* | 5611 /* |
5608 * If it is a mouse click, get the coordinates. | 5612 * If it is a mouse click, get the coordinates. |