comparison 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
comparison
equal deleted inserted replaced
12864:e98532b79dba 12865:ebb4f6c93598
50 * Also: #2223 50 * Also: #2223
51 * - implement term_setsize() 51 * - implement term_setsize()
52 * - Termdebug does not work when Vim build with mzscheme. gdb hangs. 52 * - Termdebug does not work when Vim build with mzscheme. gdb hangs.
53 * - MS-Windows GUI: WinBar has tearoff item 53 * - MS-Windows GUI: WinBar has tearoff item
54 * - MS-Windows GUI: still need to type a key after shell exits? #1924 54 * - MS-Windows GUI: still need to type a key after shell exits? #1924
55 * - After executing a shell command the status line isn't redraw.
55 * - What to store in a session file? Shell at the prompt would be OK to 56 * - What to store in a session file? Shell at the prompt would be OK to
56 * restore, but others may not. Open the window and let the user start the 57 * restore, but others may not. Open the window and let the user start the
57 * command? 58 * command?
58 * - add test for giving error for invalid 'termsize' value. 59 * - add test for giving error for invalid 'termsize' value.
59 * - support minimal size when 'termsize' is "rows*cols". 60 * - support minimal size when 'termsize' is "rows*cols".
715 { 716 {
716 VTermModifier mod = VTERM_MOD_NONE; 717 VTermModifier mod = VTERM_MOD_NONE;
717 718
718 vterm_mouse_move(vterm, mouse_row - W_WINROW(curwin), 719 vterm_mouse_move(vterm, mouse_row - W_WINROW(curwin),
719 mouse_col - curwin->w_wincol, mod); 720 mouse_col - curwin->w_wincol, mod);
720 vterm_mouse_button(vterm, button, pressed, mod); 721 if (button != 0)
722 vterm_mouse_button(vterm, button, pressed, mod);
721 return TRUE; 723 return TRUE;
722 } 724 }
723 725
724 /* 726 /*
725 * Convert typed key "c" into bytes to send to the job. 727 * Convert typed key "c" into bytes to send to the job.
816 case K_LEFTMOUSE: 818 case K_LEFTMOUSE:
817 case K_LEFTMOUSE_NM: other = term_send_mouse(vterm, 1, 1); break; 819 case K_LEFTMOUSE_NM: other = term_send_mouse(vterm, 1, 1); break;
818 case K_LEFTDRAG: other = term_send_mouse(vterm, 1, 1); break; 820 case K_LEFTDRAG: other = term_send_mouse(vterm, 1, 1); break;
819 case K_LEFTRELEASE: 821 case K_LEFTRELEASE:
820 case K_LEFTRELEASE_NM: other = term_send_mouse(vterm, 1, 0); break; 822 case K_LEFTRELEASE_NM: other = term_send_mouse(vterm, 1, 0); break;
823 case K_MOUSEMOVE: other = term_send_mouse(vterm, 0, 0); break;
821 case K_MIDDLEMOUSE: other = term_send_mouse(vterm, 2, 1); break; 824 case K_MIDDLEMOUSE: other = term_send_mouse(vterm, 2, 1); break;
822 case K_MIDDLEDRAG: other = term_send_mouse(vterm, 2, 1); break; 825 case K_MIDDLEDRAG: other = term_send_mouse(vterm, 2, 1); break;
823 case K_MIDDLERELEASE: other = term_send_mouse(vterm, 2, 0); break; 826 case K_MIDDLERELEASE: other = term_send_mouse(vterm, 2, 0); break;
824 case K_RIGHTMOUSE: other = term_send_mouse(vterm, 3, 1); break; 827 case K_RIGHTMOUSE: other = term_send_mouse(vterm, 3, 1); break;
825 case K_RIGHTDRAG: other = term_send_mouse(vterm, 3, 1); break; 828 case K_RIGHTDRAG: other = term_send_mouse(vterm, 3, 1); break;
1282 /* FALLTHROUGH */ 1285 /* FALLTHROUGH */
1283 case K_LEFTMOUSE: 1286 case K_LEFTMOUSE:
1284 case K_LEFTMOUSE_NM: 1287 case K_LEFTMOUSE_NM:
1285 case K_LEFTRELEASE: 1288 case K_LEFTRELEASE:
1286 case K_LEFTRELEASE_NM: 1289 case K_LEFTRELEASE_NM:
1290 case K_MOUSEMOVE:
1287 case K_MIDDLEMOUSE: 1291 case K_MIDDLEMOUSE:
1288 case K_MIDDLERELEASE: 1292 case K_MIDDLERELEASE:
1289 case K_RIGHTMOUSE: 1293 case K_RIGHTMOUSE:
1290 case K_RIGHTRELEASE: 1294 case K_RIGHTRELEASE:
1291 case K_X1MOUSE: 1295 case K_X1MOUSE: