mirror of
https://github.com/vim/vim.git
synced 2025-10-16 07:24:23 -04:00
patch 9.0.1028: mouse shape test is flaky, especially on Mac OS
Problem: Mouse shape test is flaky, especially on Mac OS. Solution: Instead of starting all timers at the same time, start the next one in the callback of the previous one. (Yee Cheng Chin, closes #11673) Also use "bwipe!" instead of "close!" to avoid swap files remaining.
This commit is contained in:
committed by
Bram Moolenaar
parent
647b8dfa7f
commit
1881abfc34
@@ -249,9 +249,10 @@ func Test_normal_formatexpr_returns_nonzero()
|
|||||||
setlocal formatexpr=Format()
|
setlocal formatexpr=Format()
|
||||||
normal VGgq
|
normal VGgq
|
||||||
call assert_equal(['one two'], getline(1, '$'))
|
call assert_equal(['one two'], getline(1, '$'))
|
||||||
|
|
||||||
setlocal formatexpr=
|
setlocal formatexpr=
|
||||||
delfunc Format
|
delfunc Format
|
||||||
close!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for using a script-local function for 'formatexpr'
|
" Test for using a script-local function for 'formatexpr'
|
||||||
@@ -1279,7 +1280,7 @@ func Test_vert_scroll_cmds()
|
|||||||
call assert_equal(15, line('w$'))
|
call assert_equal(15, line('w$'))
|
||||||
|
|
||||||
set foldenable&
|
set foldenable&
|
||||||
close!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_scroll_in_ex_mode()
|
func Test_scroll_in_ex_mode()
|
||||||
@@ -2290,7 +2291,7 @@ func Test_normal_section()
|
|||||||
call assert_equal(2, line('.'))
|
call assert_equal(2, line('.'))
|
||||||
call assert_equal(-1, foldclosedend(line('.')))
|
call assert_equal(-1, foldclosedend(line('.')))
|
||||||
|
|
||||||
close!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for changing case using u, U, gu, gU and ~ (tilde) commands
|
" Test for changing case using u, U, gu, gU and ~ (tilde) commands
|
||||||
@@ -2387,7 +2388,8 @@ func Test_normal_changecase_turkish()
|
|||||||
" can't use Turkish locale
|
" can't use Turkish locale
|
||||||
throw 'Skipped: Turkish locale not available'
|
throw 'Skipped: Turkish locale not available'
|
||||||
endtry
|
endtry
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for r (replace) command
|
" Test for r (replace) command
|
||||||
@@ -2915,7 +2917,8 @@ func Test_normal_nvend()
|
|||||||
call assert_equal([4, 5], [line('.'), col('.')])
|
call assert_equal([4, 5], [line('.'), col('.')])
|
||||||
exe "normal! \<C-End>"
|
exe "normal! \<C-End>"
|
||||||
call assert_equal([10, 6], [line('.'), col('.')])
|
call assert_equal([10, 6], [line('.'), col('.')])
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for cw cW ce
|
" Test for cw cW ce
|
||||||
@@ -3395,7 +3398,7 @@ func Test_java_motion()
|
|||||||
call assert_equal([7, 8, 15], [line('.'), col('.'), virtcol('.')])
|
call assert_equal([7, 8, 15], [line('.'), col('.'), virtcol('.')])
|
||||||
call assert_equal(-1, foldclosedend(7))
|
call assert_equal(-1, foldclosedend(7))
|
||||||
|
|
||||||
close!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Tests for g cmds
|
" Tests for g cmds
|
||||||
@@ -3510,7 +3513,8 @@ func Test_normal_yank_with_excmd()
|
|||||||
let @a = ''
|
let @a = ''
|
||||||
call feedkeys("\"ay:if v:true\<CR>normal l\<CR>endif\<CR>", 'xt')
|
call feedkeys("\"ay:if v:true\<CR>normal l\<CR>endif\<CR>", 'xt')
|
||||||
call assert_equal('f', @a)
|
call assert_equal('f', @a)
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for supplying a count to a normal-mode command across a cursorhold call
|
" Test for supplying a count to a normal-mode command across a cursorhold call
|
||||||
@@ -3531,7 +3535,8 @@ func Test_normal_cursorhold_with_count()
|
|||||||
au!
|
au!
|
||||||
augroup END
|
augroup END
|
||||||
au! normalcHoldTest
|
au! normalcHoldTest
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
delfunc s:cHold
|
delfunc s:cHold
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -3555,7 +3560,8 @@ func Test_horiz_motion()
|
|||||||
call assert_equal(11, col('.'))
|
call assert_equal(11, col('.'))
|
||||||
exe "normal! $\<C-BS>"
|
exe "normal! $\<C-BS>"
|
||||||
call assert_equal(10, col('.'))
|
call assert_equal(10, col('.'))
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for using a : command in operator pending mode
|
" Test for using a : command in operator pending mode
|
||||||
@@ -3563,7 +3569,7 @@ func Test_normal_colon_op()
|
|||||||
new
|
new
|
||||||
call setline(1, ['one', 'two'])
|
call setline(1, ['one', 'two'])
|
||||||
call assert_beeps("normal! Gc:d\<CR>")
|
call assert_beeps("normal! Gc:d\<CR>")
|
||||||
close!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for d and D commands
|
" Test for d and D commands
|
||||||
@@ -3588,7 +3594,7 @@ func Test_normal_delete_cmd()
|
|||||||
call assert_fails('normal D', 'E21:')
|
call assert_fails('normal D', 'E21:')
|
||||||
call assert_fails('normal d$', 'E21:')
|
call assert_fails('normal d$', 'E21:')
|
||||||
|
|
||||||
close!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for deleting or changing characters across lines with 'whichwrap'
|
" Test for deleting or changing characters across lines with 'whichwrap'
|
||||||
@@ -3608,7 +3614,8 @@ func Test_normal_op_across_lines()
|
|||||||
call setline(1, ['one two', 'three four'])
|
call setline(1, ['one two', 'three four'])
|
||||||
exe "norm! $3x"
|
exe "norm! $3x"
|
||||||
call assert_equal(['one twhree four'], getline(1, '$'))
|
call assert_equal(['one twhree four'], getline(1, '$'))
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
set whichwrap&
|
set whichwrap&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -3646,11 +3653,11 @@ func Test_normal_word_move()
|
|||||||
normal 3Gyb
|
normal 3Gyb
|
||||||
call assert_equal("two\n ", @")
|
call assert_equal("two\n ", @")
|
||||||
|
|
||||||
close!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for 'scrolloff' with a long line that doesn't fit in the screen
|
" Test for 'scrolloff' with a long line that doesn't fit in the screen
|
||||||
func Test_normal_scroloff()
|
func Test_normal_scrolloff()
|
||||||
10new
|
10new
|
||||||
60vnew
|
60vnew
|
||||||
call setline(1, ' 1 ' .. repeat('a', 57)
|
call setline(1, ' 1 ' .. repeat('a', 57)
|
||||||
@@ -3691,8 +3698,9 @@ func Test_normal_scroloff()
|
|||||||
call assert_equal(1, winline())
|
call assert_equal(1, winline())
|
||||||
normal $
|
normal $
|
||||||
call assert_equal(10, winline())
|
call assert_equal(10, winline())
|
||||||
|
|
||||||
set scrolloff&
|
set scrolloff&
|
||||||
close!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for vertical scrolling with CTRL-F and CTRL-B with a long line
|
" Test for vertical scrolling with CTRL-F and CTRL-B with a long line
|
||||||
@@ -3712,7 +3720,8 @@ func Test_normal_vert_scroll_longline()
|
|||||||
exe "normal \<C-B>\<C-B>"
|
exe "normal \<C-B>\<C-B>"
|
||||||
call assert_equal(5, line('.'))
|
call assert_equal(5, line('.'))
|
||||||
call assert_equal(5, winline())
|
call assert_equal(5, winline())
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for jumping in a file using %
|
" Test for jumping in a file using %
|
||||||
@@ -3725,7 +3734,8 @@ func Test_normal_percent_jump()
|
|||||||
call feedkeys('50%', 'xt')
|
call feedkeys('50%', 'xt')
|
||||||
call assert_equal(50, line('.'))
|
call assert_equal(50, line('.'))
|
||||||
call assert_equal(-1, foldclosedend(50))
|
call assert_equal(-1, foldclosedend(50))
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for << and >> commands to shift text by 'shiftwidth'
|
" Test for << and >> commands to shift text by 'shiftwidth'
|
||||||
@@ -3818,24 +3828,25 @@ func Test_mouse_shape_after_failed_change()
|
|||||||
CheckCanRunGui
|
CheckCanRunGui
|
||||||
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
|
vim9script
|
||||||
set mouseshape+=o:busy
|
set mouseshape+=o:busy
|
||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
let g:mouse_shapes = []
|
var mouse_shapes = []
|
||||||
|
|
||||||
func SaveMouseShape(timer)
|
feedkeys('c')
|
||||||
let g:mouse_shapes += [getmouseshape()]
|
timer_start(50, (_) => {
|
||||||
endfunc
|
mouse_shapes += [getmouseshape()]
|
||||||
|
timer_start(50, (_) => {
|
||||||
func SaveAndQuit(timer)
|
feedkeys('c')
|
||||||
call writefile(g:mouse_shapes, 'Xmouseshapes')
|
timer_start(50, (_) => {
|
||||||
quit
|
mouse_shapes += [getmouseshape()]
|
||||||
endfunc
|
timer_start(50, (_) => {
|
||||||
|
writefile(mouse_shapes, 'Xmouseshapes')
|
||||||
call timer_start(50, {_ -> feedkeys('c')})
|
quit
|
||||||
call timer_start(100, 'SaveMouseShape')
|
})
|
||||||
call timer_start(150, {_ -> feedkeys('c')})
|
})
|
||||||
call timer_start(200, 'SaveMouseShape')
|
})
|
||||||
call timer_start(250, 'SaveAndQuit')
|
})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xmouseshape.vim', 'D')
|
call writefile(lines, 'Xmouseshape.vim', 'D')
|
||||||
call RunVim([], [], "-g -S Xmouseshape.vim")
|
call RunVim([], [], "-g -S Xmouseshape.vim")
|
||||||
|
@@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1028,
|
||||||
/**/
|
/**/
|
||||||
1027,
|
1027,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user