Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
24981:f8566203119e | 24982:4cb423b9250d |
---|---|
1214 mouse_row = (time_t)tv_get_number(&argvars[0]) - 1; | 1214 mouse_row = (time_t)tv_get_number(&argvars[0]) - 1; |
1215 mouse_col = (time_t)tv_get_number(&argvars[1]) - 1; | 1215 mouse_col = (time_t)tv_get_number(&argvars[1]) - 1; |
1216 } | 1216 } |
1217 | 1217 |
1218 void | 1218 void |
1219 f_test_gui_mouse_event(typval_T *argvars UNUSED, typval_T *rettv UNUSED) | |
1220 { | |
1221 #ifdef FEAT_GUI | |
1222 int button = tv_get_number(&argvars[0]); | |
1223 int row = tv_get_number(&argvars[1]); | |
1224 int col = tv_get_number(&argvars[2]); | |
1225 int repeated_click = tv_get_number(&argvars[3]); | |
1226 int_u mods = tv_get_number(&argvars[4]); | |
1227 | |
1228 gui_send_mouse_event(button, TEXT_X(col - 1), TEXT_Y(row - 1), repeated_click, mods); | |
1229 #endif | |
1230 } | |
1231 | |
1232 void | |
1219 f_test_settime(typval_T *argvars, typval_T *rettv UNUSED) | 1233 f_test_settime(typval_T *argvars, typval_T *rettv UNUSED) |
1220 { | 1234 { |
1221 time_for_testing = (time_t)tv_get_number(&argvars[0]); | 1235 time_for_testing = (time_t)tv_get_number(&argvars[0]); |
1222 } | 1236 } |
1223 | 1237 |