diff src/testing.c @ 24982:4cb423b9250d v8.2.3028

patch 8.2.3028: GUI mouse events not tested Commit: https://github.com/vim/vim/commit/f1e7449d567c630601aa0cec6c663b791785a668 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Jun 21 18:44:26 2021 +0200 patch 8.2.3028: GUI mouse events not tested Problem: GUI mouse events not tested. Solution: Add test_gui_mouse_event(). Add mouse tests. Also add a few viminfo tests. (Yegappan Lakshmanan, closes #8407)
author Bram Moolenaar <Bram@vim.org>
date Mon, 21 Jun 2021 18:45:04 +0200
parents a4fda40e0bb9
children 3b1770226f85
line wrap: on
line diff
--- a/src/testing.c
+++ b/src/testing.c
@@ -1216,6 +1216,20 @@ f_test_setmouse(typval_T *argvars, typva
 }
 
     void
+f_test_gui_mouse_event(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
+{
+#ifdef FEAT_GUI
+    int		button = tv_get_number(&argvars[0]);
+    int		row = tv_get_number(&argvars[1]);
+    int		col = tv_get_number(&argvars[2]);
+    int		repeated_click = tv_get_number(&argvars[3]);
+    int_u	mods = tv_get_number(&argvars[4]);
+
+    gui_send_mouse_event(button, TEXT_X(col - 1), TEXT_Y(row - 1), repeated_click, mods);
+#endif
+}
+
+    void
 f_test_settime(typval_T *argvars, typval_T *rettv UNUSED)
 {
     time_for_testing = (time_t)tv_get_number(&argvars[0]);