comparison src/os_unix.c @ 12871:1a450ce6980c v8.0.1312

patch 8.0.1312: balloon_show() only works in terminal when compiled with GUI commit https://github.com/vim/vim/commit/c3719bd87beca9f72d2e9f11e36d561c2c3b57b0 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 18 22:13:31 2017 +0100 patch 8.0.1312: balloon_show() only works in terminal when compiled with GUI Problem: balloon_show() only works in terminal when compiled with the GUI. Solution: Add FEAT_BEVAL_GUI and refactor to move common code out of the GUI specific file.
author Christian Brabandt <cb@256bit.org>
date Sat, 18 Nov 2017 22:15:05 +0100
parents ebb4f6c93598
children 1bdc12630fc0
comparison
equal deleted inserted replaced
12870:0469872186f5 12871:1a450ce6980c
473 /* If there is readahead then parse_queued_messages() timed out and we 473 /* If there is readahead then parse_queued_messages() timed out and we
474 * should call it again soon. */ 474 * should call it again soon. */
475 if ((wait_time < 0 || wait_time > 100L) && channel_any_readahead()) 475 if ((wait_time < 0 || wait_time > 100L) && channel_any_readahead())
476 wait_time = 10L; 476 wait_time = 10L;
477 #endif 477 #endif
478 #ifdef FEAT_BEVAL 478 #ifdef FEAT_BEVAL_GUI
479 if (p_beval && wait_time > 100L) 479 if (p_beval && wait_time > 100L)
480 /* The 'balloonexpr' may indirectly invoke a callback while waiting 480 /* The 'balloonexpr' may indirectly invoke a callback while waiting
481 * for a character, need to check often. */ 481 * for a character, need to check often. */
482 wait_time = 100L; 482 wait_time = 100L;
483 #endif 483 #endif
3570 * Set mouse clicks on or off. 3570 * Set mouse clicks on or off.
3571 */ 3571 */
3572 void 3572 void
3573 mch_setmouse(int on) 3573 mch_setmouse(int on)
3574 { 3574 {
3575 # ifdef FEAT_BEVALTERM 3575 # ifdef FEAT_BEVAL_TERM
3576 static int bevalterm_ison = FALSE; 3576 static int bevalterm_ison = FALSE;
3577 # endif 3577 # endif
3578 int xterm_mouse_vers; 3578 int xterm_mouse_vers;
3579 3579
3580 if (on == mouse_ison 3580 if (on == mouse_ison
3581 # ifdef FEAT_BEVALTERM 3581 # ifdef FEAT_BEVAL_TERM
3582 && p_bevalterm == bevalterm_ison 3582 && p_bevalterm == bevalterm_ison
3583 # endif 3583 # endif
3584 ) 3584 )
3585 /* return quickly if nothing to do */ 3585 /* return quickly if nothing to do */
3586 return; 3586 return;
3608 : IF_EB("\033[?1006l", ESC_STR "[?1006l"))); 3608 : IF_EB("\033[?1006l", ESC_STR "[?1006l")));
3609 mouse_ison = on; 3609 mouse_ison = on;
3610 } 3610 }
3611 # endif 3611 # endif
3612 3612
3613 # ifdef FEAT_BEVALTERM 3613 # ifdef FEAT_BEVAL_TERM
3614 if (bevalterm_ison != (p_bevalterm && on)) 3614 if (bevalterm_ison != (p_bevalterm && on))
3615 { 3615 {
3616 bevalterm_ison = (p_bevalterm && on); 3616 bevalterm_ison = (p_bevalterm && on);
3617 if (xterm_mouse_vers > 1 && !bevalterm_ison) 3617 if (xterm_mouse_vers > 1 && !bevalterm_ison)
3618 /* disable mouse movement events, enabling is below */ 3618 /* disable mouse movement events, enabling is below */
3625 { 3625 {
3626 if (on) /* enable mouse events, use mouse tracking if available */ 3626 if (on) /* enable mouse events, use mouse tracking if available */
3627 out_str_nf((char_u *) 3627 out_str_nf((char_u *)
3628 (xterm_mouse_vers > 1 3628 (xterm_mouse_vers > 1
3629 ? ( 3629 ? (
3630 # ifdef FEAT_BEVALTERM 3630 # ifdef FEAT_BEVAL_TERM
3631 bevalterm_ison 3631 bevalterm_ison
3632 ? IF_EB("\033[?1003h", ESC_STR "[?1003h") : 3632 ? IF_EB("\033[?1003h", ESC_STR "[?1003h") :
3633 # endif 3633 # endif
3634 IF_EB("\033[?1002h", ESC_STR "[?1002h")) 3634 IF_EB("\033[?1002h", ESC_STR "[?1002h"))
3635 : IF_EB("\033[?1000h", ESC_STR "[?1000h"))); 3635 : IF_EB("\033[?1000h", ESC_STR "[?1000h")));
3733 mouse_ison = on; 3733 mouse_ison = on;
3734 } 3734 }
3735 # endif 3735 # endif
3736 } 3736 }
3737 3737
3738 #if defined(FEAT_BEVALTERM) || defined(PROTO) 3738 #if defined(FEAT_BEVAL_TERM) || defined(PROTO)
3739 /* 3739 /*
3740 * Called when 'balloonevalterm' changed. 3740 * Called when 'balloonevalterm' changed.
3741 */ 3741 */
3742 void 3742 void
3743 mch_bevalterm_changed(void) 3743 mch_bevalterm_changed(void)