mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 05:16:09 +00:00
vim-patch:7.4.1300
Problem: Cannot test CursorMovedI because there is typeahead.
Solution: Add disable_char_avail_for_testing().
2ab375e54e
Most of it manually applied.
This commit is contained in:

committed by
Justin M. Keyes

parent
ad99d0bf7e
commit
11fd965554
@@ -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);
|
||||
|
Reference in New Issue
Block a user