diff src/terminal.c @ 12865:ebb4f6c93598 v8.0.1309

patch 8.0.1309: cannot use 'balloonexpr' in a terminal commit https://github.com/vim/vim/commit/51b0f3701ecb440aa72ab6017c1df6940c0e0f6f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 18 18:52:04 2017 +0100 patch 8.0.1309: cannot use 'balloonexpr' in a terminal Problem: Cannot use 'balloonexpr' in a terminal. Solution: Add 'balloonevalterm' and add code to handle mouse movements in a terminal. Initial implementation for Unix with GUI.
author Christian Brabandt <cb@256bit.org>
date Sat, 18 Nov 2017 19:00:06 +0100
parents 15696054bc6c
children 1c05b29ab125
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -52,6 +52,7 @@
  * - Termdebug does not work when Vim build with mzscheme.  gdb hangs.
  * - MS-Windows GUI: WinBar has  tearoff item
  * - MS-Windows GUI: still need to type a key after shell exits?  #1924
+ * - After executing a shell command the status line isn't redraw.
  * - What to store in a session file?  Shell at the prompt would be OK to
  *   restore, but others may not.  Open the window and let the user start the
  *   command?
@@ -717,7 +718,8 @@ term_send_mouse(VTerm *vterm, int button
 
     vterm_mouse_move(vterm, mouse_row - W_WINROW(curwin),
 					    mouse_col - curwin->w_wincol, mod);
-    vterm_mouse_button(vterm, button, pressed, mod);
+    if (button != 0)
+	vterm_mouse_button(vterm, button, pressed, mod);
     return TRUE;
 }
 
@@ -818,6 +820,7 @@ term_convert_key(term_T *term, int c, ch
 	case K_LEFTDRAG:	other = term_send_mouse(vterm, 1, 1); break;
 	case K_LEFTRELEASE:
 	case K_LEFTRELEASE_NM:	other = term_send_mouse(vterm, 1, 0); break;
+	case K_MOUSEMOVE:	other = term_send_mouse(vterm, 0, 0); break;
 	case K_MIDDLEMOUSE:	other = term_send_mouse(vterm, 2, 1); break;
 	case K_MIDDLEDRAG:	other = term_send_mouse(vterm, 2, 1); break;
 	case K_MIDDLERELEASE:	other = term_send_mouse(vterm, 2, 0); break;
@@ -1284,6 +1287,7 @@ send_keys_to_term(term_T *term, int c, i
 	case K_LEFTMOUSE_NM:
 	case K_LEFTRELEASE:
 	case K_LEFTRELEASE_NM:
+	case K_MOUSEMOVE:
 	case K_MIDDLEMOUSE:
 	case K_MIDDLERELEASE:
 	case K_RIGHTMOUSE: