0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

patch 8.1.1262: cannot simulate a mouse click in a test

Problem:    Cannot simulate a mouse click in a test.
Solution:   Add test_setmouse().
This commit is contained in:
Bram Moolenaar
2019-05-04 15:47:48 +02:00
parent 25190db225
commit bb8476be87
4 changed files with 21 additions and 1 deletions

View File

@@ -456,6 +456,7 @@ static void f_test_null_string(typval_T *argvars, typval_T *rettv);
#ifdef FEAT_GUI
static void f_test_scrollbar(typval_T *argvars, typval_T *rettv);
#endif
static void f_test_setmouse(typval_T *argvars, typval_T *rettv);
static void f_test_settime(typval_T *argvars, typval_T *rettv);
#ifdef FEAT_FLOAT
static void f_tan(typval_T *argvars, typval_T *rettv);
@@ -993,6 +994,7 @@ static struct fst
#ifdef FEAT_GUI
{"test_scrollbar", 3, 3, f_test_scrollbar},
#endif
{"test_setmouse", 2, 2, f_test_setmouse},
{"test_settime", 1, 1, f_test_settime},
#ifdef FEAT_TIMERS
{"timer_info", 0, 1, f_timer_info},
@@ -14493,6 +14495,13 @@ f_test_scrollbar(typval_T *argvars, typval_T *rettv UNUSED)
}
#endif
static void
f_test_setmouse(typval_T *argvars, typval_T *rettv UNUSED)
{
mouse_row = (time_t)tv_get_number(&argvars[0]) - 1;
mouse_col = (time_t)tv_get_number(&argvars[1]) - 1;
}
static void
f_test_settime(typval_T *argvars, typval_T *rettv UNUSED)
{