1
0
forked from aniani/vim

patch 8.0.0872: no mouse scroll with a terminal window

Problem:    Using mouse scroll while a terminal window has focus and the mouse
            pointer is on another window does not work.  Same for focus in a
            non-terminal window ahd the mouse pointer is over a terminal
            window.
Solution:   Send the scroll action to the right window.
This commit is contained in:
Bram Moolenaar
2017-08-05 19:34:47 +02:00
parent 086d535f77
commit 98fd66d311
4 changed files with 15 additions and 3 deletions

View File

@@ -37,7 +37,6 @@
*
* TODO:
* - MS-Windows: no redraw for 'updatetime' #1915
* - mouse scroll: when over other window, scroll that window.
* - add argument to term_wait() for waiting time.
* - For the scrollback buffer store lines in the buffer, only attributes in
* tl_scrollback.
@@ -909,7 +908,7 @@ term_vgetc()
* Return FAIL when the key needs to be handled in Normal mode.
* Return OK when the key was dropped or sent to the terminal.
*/
static int
int
send_keys_to_term(term_T *term, int c, int typed)
{
char msg[KEY_BUF_LEN];
@@ -948,13 +947,18 @@ send_keys_to_term(term_T *term, int c, int typed)
case K_X1RELEASE:
case K_X2MOUSE:
case K_X2RELEASE:
case K_MOUSEUP:
case K_MOUSEDOWN:
case K_MOUSELEFT:
case K_MOUSERIGHT:
if (mouse_row < W_WINROW(curwin)
|| mouse_row >= (W_WINROW(curwin) + curwin->w_height)
|| mouse_col < W_WINCOL(curwin)
|| mouse_col >= W_ENDCOL(curwin)
|| dragging_outside)
{
/* click outside the current window */
/* click or scroll outside the current window */
if (typed)
{
stuffcharReadbuff(c);