# HG changeset patch # User Christian Brabandt # Date 1538490605 -7200 # Node ID f20df682c8af38c0ee60748f94e2b24bb901dd27 # Parent b81f630a720a0d83ce274dfa7b1285787ef525f6 patch 8.1.0447: GUI scrollbar test fails with Athena and Motif commit https://github.com/vim/vim/commit/586c70cdfede55a166e3564f1cb68a299d81987d Author: Bram Moolenaar Date: Tue Oct 2 16:23:58 2018 +0200 patch 8.1.0447: GUI scrollbar test fails with Athena and Motif Problem: GUI scrollbar test fails with Athena and Motif. Solution: When not using on-the-fly scrolling call normal_cmd(). diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3588,7 +3588,7 @@ f_feedkeys(typval_T *argvars, typval_T * if (!dangerous) ++ex_normal_busy; - exec_normal(TRUE, TRUE); + exec_normal(TRUE, FALSE, TRUE); if (!dangerous) --ex_normal_busy; @@ -13233,6 +13233,10 @@ f_test_scrollbar(typval_T *argvars, typv return; } gui_drag_scrollbar(sb, value, dragging); +# ifndef USE_ON_FLY_SCROLL + // need to loop through normal_cmd() to handle the scroll events + exec_normal(FALSE, TRUE, FALSE); +# endif } #endif diff --git a/src/ex_docmd.c b/src/ex_docmd.c --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -10471,21 +10471,24 @@ exec_normal_cmd(char_u *cmd, int remap, { /* Stuff the argument into the typeahead buffer. */ ins_typebuf(cmd, remap, 0, TRUE, silent); - exec_normal(FALSE, FALSE); + exec_normal(FALSE, FALSE, FALSE); } /* * Execute normal_cmd() until there is no typeahead left. + * When "use_vpeekc" is TRUE use vpeekc() to check for available chars. */ void -exec_normal(int was_typed, int may_use_terminal_loop UNUSED) +exec_normal(int was_typed, int use_vpeekc, int may_use_terminal_loop UNUSED) { oparg_T oa; clear_oparg(&oa); finish_op = FALSE; - while ((!stuff_empty() || ((was_typed || !typebuf_typed()) - && typebuf.tb_len > 0)) && !got_int) + while ((!stuff_empty() + || ((was_typed || !typebuf_typed()) && typebuf.tb_len > 0) + || (use_vpeekc && vpeekc() != NUL)) + && !got_int) { update_topline_cursor(); #ifdef FEAT_TERMINAL diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro --- a/src/proto/ex_docmd.pro +++ b/src/proto/ex_docmd.pro @@ -59,7 +59,7 @@ int save_current_state(save_state_T *sst void restore_current_state(save_state_T *sst); void ex_normal(exarg_T *eap); void exec_normal_cmd(char_u *cmd, int remap, int silent); -void exec_normal(int was_typed, int may_use_terminal_loop); +void exec_normal(int was_typed, int use_vpeekc, int may_use_terminal_loop); int find_cmdline_var(char_u *src, int *usedlen); char_u *eval_vars(char_u *src, char_u *srcstart, int *usedlen, linenr_T *lnump, char_u **errormsg, int *escaped); char_u *expand_sfile(char_u *arg); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -793,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 447, +/**/ 446, /**/ 445,