diff options
author | KillTheMule <KillTheMule@users.noreply.github.com> | 2016-04-18 21:06:04 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-04-25 06:34:28 -0400 |
commit | 11fd9655542fd2676e13d00791b4bc9e96772300 (patch) | |
tree | 80fbc7e5a2ae393a6b75fdb979255b56185e7afe /src/nvim/eval.c | |
parent | ad99d0bf7e291564dd858f8206db52311f8878cc (diff) | |
download | rneovim-11fd9655542fd2676e13d00791b4bc9e96772300.tar.gz rneovim-11fd9655542fd2676e13d00791b4bc9e96772300.tar.bz2 rneovim-11fd9655542fd2676e13d00791b4bc9e96772300.zip |
vim-patch:7.4.1300
Problem: Cannot test CursorMovedI because there is typeahead.
Solution: Add disable_char_avail_for_testing().
https://github.com/vim/vim/commit/2ab375e54ef4eac438d1aef8b99d9e71f2fa0c63
Most of it manually applied.
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 9553c7a7ed..60ebc34ea9 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6707,6 +6707,7 @@ static struct fst { { "did_filetype", 0, 0, f_did_filetype }, { "diff_filler", 1, 1, f_diff_filler }, { "diff_hlID", 2, 2, f_diff_hlID }, + {"disable_char_avail_for_testing", 1, 1, f_disable_char_avail_for_testing}, { "empty", 1, 1, f_empty }, { "escape", 2, 2, f_escape }, { "eval", 1, 1, f_eval }, @@ -8582,6 +8583,15 @@ static void f_diff_hlID(typval_T *argvars, typval_T *rettv) rettv->vval.v_number = hlID == (hlf_T)0 ? 0 : (int)hlID; } +// +// "disable_char_avail_for_testing({expr})" function +// +static void f_disable_char_avail_for_testing(typval_T *argvars, typval_T *rettv) + FUNC_ATTR_NONNULL_ARG(1) +{ + disable_char_avail_for_testing = get_tv_number(&argvars[0]); +} + /* * "empty({expr})" function */ @@ -10173,6 +10183,7 @@ static void getpos_both(typval_T *argvars, typval_T *rettv, bool getcurpos) list_append_number(l, (fp != NULL) ? (varnumber_T)fp->coladd : (varnumber_T)0); if (getcurpos) { + update_curswant(); list_append_number(l, curwin->w_curswant == MAXCOL ? (varnumber_T)MAXCOL : (varnumber_T)curwin->w_curswant + 1); |