Fix regression/0-mouse-during-insert test flakyness

Do not rely on timing but wait for Kakoune to redraw which is what
we actually need: Mouse clicks rely on the current display buffer
to resolve the buffer location, so we need to wait for a redraw
to happen with `ui_out`
This commit is contained in:
Maxime Coste 2023-08-05 10:58:15 +10:00
parent d7822ea588
commit 39be51b55c

View File

@ -1,15 +1,10 @@
ui_out -ignore 4
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "i" ] }'
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "a" ] }'
sleep .1
ui_out -ignore 4
ui_in '{ "jsonrpc": "2.0", "method": "mouse_press", "params": [ "left", 0, 2 ] }'
sleep .1
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "b" ] }'
sleep .1
ui_out -ignore 4
ui_in '{ "jsonrpc": "2.0", "method": "mouse_release", "params": [ "left", 0, 4 ] }'
sleep .1
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "c<esc>" ] }'
sleep .1
if [ -n "$CI" ]; then
sleep 1
fi
ui_out -ignore 1