Skip to content

Commit

Permalink
Fix regression/0-mouse-during-insert test flakyness
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
mawww committed Aug 5, 2023
1 parent d7822ea commit 39be51b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions test/regression/0-mouse-during-insert/script
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 39be51b

Please sign in to comment.