1
0
forked from aniani/vim

patch 8.2.3040: GUI: dropping files not tested

Problem:    GUI: dropping files not tested.
Solution:   Add test_gui_drop_files() and tests. (Yegappan Lakshmanan,
            closes #8434)
This commit is contained in:
Yegappan Lakshmanan
2021-06-23 20:46:52 +02:00
committed by Bram Moolenaar
parent 8cec9273d2
commit 18d46587b9
9 changed files with 174 additions and 5 deletions

View File

@@ -3022,6 +3022,8 @@ test_feedinput({string}) none add key sequence to input buffer
test_garbagecollect_now() none free memory right now for testing
test_garbagecollect_soon() none free memory soon for testing
test_getvalue({string}) any get value of an internal variable
test_gui_drop_files({list}, {row}, {col}, {mods})
none drop a list of files in a window
test_gui_mouse_event({button}, {row}, {col}, {repeated}, {mods})
none add a mouse event to the input buffer
test_ignore_error({expr}) none ignore a specific error

View File

@@ -79,10 +79,23 @@ test_getvalue({name}) *test_getvalue()*
Can also be used as a |method|: >
GetName()->test_getvalue()
<
*test_gui_drop_files()*
test_gui_drop_files({list}, {row}, {col}, {mods})
Drop one or more files in {list} in the window at {row}, {col}.
This function only works when the GUI is running.
The supported values for {mods} are:
0x4 Shift
0x8 Alt
0x10 Ctrl
The files are added to the argument list and the first file in
{list} is edited in the window. See |drag-n-drop| for more
information.
*test_gui_mouse_event()*
test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers})
Inject a mouse button click event. This function works only
when GUI is running.
Inject a mouse button click event. This function only works
when the GUI is running.
The supported values for {button} are:
0 right mouse button
1 middle mouse button
@@ -92,7 +105,9 @@ test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers})
5 scroll wheel up
6 scroll wheel left
7 scroll wheel right
{row} and {col} specify the location of the mouse click.
{row} and {col} specify the location of the mouse click. The
first row of the Vim window is 1 and the last row is 'lines'.
The maximum value of {col} is 'columns'.
To inject a multiclick event, set {multiclick} to 1.
The supported values for {modifiers} are:
4 shift is pressed

View File

@@ -1021,6 +1021,7 @@ Testing: *test-functions*
test_garbagecollect_now() free memory right now
test_garbagecollect_soon() set a flag to free memory soon
test_getvalue() get value of an internal variable
test_gui_drop_files() drop file(s) in a window
test_gui_mouse_event() add a GUI mouse event to the input buffer
test_ignore_error() ignore a specific error message
test_null_blob() return a null Blob