diff src/evalfunc.c @ 16517:9484fc00ac6b v8.1.1262

patch 8.1.1262: cannot simulate a mouse click in a test commit https://github.com/vim/vim/commit/bb8476be871811e40ddc88c598d9e553aba7fb79 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 4 15:47:48 2019 +0200 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().
author Bram Moolenaar <Bram@vim.org>
date Sat, 04 May 2019 16:00:05 +0200
parents 42910f306377
children 5412fcd03ecb
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -456,6 +456,7 @@ static void f_test_null_string(typval_T 
 #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},
@@ -14494,6 +14496,13 @@ f_test_scrollbar(typval_T *argvars, typv
 #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)
 {
     time_for_testing = (time_t)tv_get_number(&argvars[0]);