0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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)
This commit is contained in:
Yegappan Lakshmanan
2021-06-21 18:44:26 +02:00
committed by Bram Moolenaar
parent 2ac4b2536a
commit f1e7449d56
9 changed files with 337 additions and 5 deletions

View File

@@ -1215,6 +1215,20 @@ f_test_setmouse(typval_T *argvars, typval_T *rettv UNUSED)
mouse_col = (time_t)tv_get_number(&argvars[1]) - 1;
}
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)
{