diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-03-01 20:32:44 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-03-01 20:32:44 +0100 |
commit | 59716a27bd5c6c64def6c3ca430ff1246deae749 (patch) | |
tree | a7db246338a5e0c8aaf8222f6b70d6b41325bbeb /src | |
parent | f8ab1b14fd972a093e0c12146dd3becd511eb519 (diff) | |
download | vim-59716a27bd5c6c64def6c3ca430ff1246deae749.zip |
patch 8.0.0396: 'balloonexpr' only works synchronously
Problem: 'balloonexpr' only works synchronously.
Solution: Add balloon_show(). (Jusufadis Bakamovic, closes #1449)
Diffstat (limited to 'src')
-rw-r--r-- | src/evalfunc.c | 17 | ||||
-rw-r--r-- | src/os_unix.c | 6 | ||||
-rw-r--r-- | src/os_win32.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 31 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index a470ff996..70b90ad17 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -58,6 +58,9 @@ static void f_asin(typval_T *argvars, typval_T *rettv); static void f_atan(typval_T *argvars, typval_T *rettv); static void f_atan2(typval_T *argvars, typval_T *rettv); #endif +#ifdef FEAT_BEVAL +static void f_balloon_show(typval_T *argvars, typval_T *rettv); +#endif static void f_browse(typval_T *argvars, typval_T *rettv); static void f_browsedir(typval_T *argvars, typval_T *rettv); static void f_bufexists(typval_T *argvars, typval_T *rettv); @@ -484,6 +487,9 @@ static struct fst {"atan", 1, 1, f_atan}, {"atan2", 2, 2, f_atan2}, #endif +#ifdef FEAT_BEVAL + {"balloon_show", 1, 1, f_balloon_show}, +#endif {"browse", 4, 4, f_browse}, {"browsedir", 2, 2, f_browsedir}, {"bufexists", 1, 1, f_bufexists}, @@ -1363,6 +1369,17 @@ f_atan2(typval_T *argvars, typval_T *rettv) #endif /* + * "balloon_show()" function + */ +#ifdef FEAT_BEVAL + static void +f_balloon_show(typval_T *argvars, typval_T *rettv UNUSED) +{ + gui_mch_post_balloon(balloonEval, get_tv_string_chk(&argvars[0])); +} +#endif + +/* * "browse(save, title, initdir, default)" function */ static void diff --git a/src/os_unix.c b/src/os_unix.c index 48359d31e..6220044b6 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -467,6 +467,12 @@ mch_inchar( if ((wait_time < 0 || wait_time > 100L) && channel_any_readahead()) wait_time = 10L; #endif +#ifdef FEAT_BEVAL + if (p_beval && wait_time > 100L) + /* The 'balloonexpr' may indirectly invoke a callback while waiting + * for a character, need to check often. */ + wait_time = 100L; +#endif /* * We want to be interrupted by the winch signal diff --git a/src/os_win32.c b/src/os_win32.c index adbb199b9..a3048427c 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -1467,6 +1467,12 @@ WaitForChar(long msec) dwWaitTime = 10; } #endif +#ifdef FEAT_BEVAL + if (p_beval && dwWaitTime > 100) + /* The 'balloonexpr' may indirectly invoke a callback while + * waiting for a character, need to check often. */ + dwWaitTime = 100; +#endif #ifdef FEAT_MZSCHEME if (mzthreads_allowed() && p_mzq > 0 && (msec < 0 || (long)dwWaitTime > p_mzq)) diff --git a/src/version.c b/src/version.c index 796162be8..0c9731d3f 100644 --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 396, +/**/ 395, /**/ 394, |