comparison src/testdir/test_autocmd.vim @ 23847:b0e7fa957cd1 v8.2.2465

patch 8.2.2465: using freed memory in :psearch Commit: https://github.com/vim/vim/commit/92bb83e41ca42d0d00d21753810d92485c808a50 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 3 23:04:46 2021 +0100 patch 8.2.2465: using freed memory in :psearch Problem: Using freed memory in :psearch. (houyunsong) Solution: Check the current window is still valid. Fix flaky test.
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Feb 2021 23:15:04 +0100
parents 7517eb94239b
children 5d11a15dbaa9
comparison
equal deleted inserted replaced
23846:3b6bca71ab93 23847:b0e7fa957cd1
58 call feedkeys("ggG", "xt") 58 call feedkeys("ggG", "xt")
59 59
60 let g:triggered = 0 60 let g:triggered = 0
61 au CursorHoldI * let g:triggered += 1 61 au CursorHoldI * let g:triggered += 1
62 set updatetime=20 62 set updatetime=20
63 call timer_start(100, 'ExitInsertMode') 63 call timer_start(200, 'ExitInsertMode')
64 call feedkeys('a', 'x!') 64 call feedkeys('a', 'x!')
65 call assert_equal(1, g:triggered) 65 call assert_equal(1, g:triggered)
66 unlet g:triggered 66 unlet g:triggered
67 au! CursorHoldI 67 au! CursorHoldI
68 set updatetime& 68 set updatetime&
2411 func Test_autocmd_was_using_freed_memory() 2411 func Test_autocmd_was_using_freed_memory()
2412 CheckFeature quickfix 2412 CheckFeature quickfix
2413 2413
2414 pedit xx 2414 pedit xx
2415 n x 2415 n x
2416 au WinEnter * quit 2416 augroup winenter
2417 au WinEnter * if winnr('$') > 2 | quit | endif
2418 augroup END
2417 split 2419 split
2418 au! WinEnter 2420
2421 augroup winenter
2422 au! WinEnter
2423 augroup END
2424
2425 bwipe xx
2426 bwipe x
2427 pclose
2419 endfunc 2428 endfunc
2420 2429
2421 func Test_BufWrite_lockmarks() 2430 func Test_BufWrite_lockmarks()
2422 edit! Xtest 2431 edit! Xtest
2423 call setline(1, ['a', 'b', 'c', 'd']) 2432 call setline(1, ['a', 'b', 'c', 'd'])
2735 bwipe % 2744 bwipe %
2736 au! BufNew 2745 au! BufNew
2737 au! BufWinLeave 2746 au! BufWinLeave
2738 endfunc 2747 endfunc
2739 2748
2749 func Test_autocmd_quit_psearch()
2750 sn aa bb
2751 augroup aucmd_win_test
2752 au!
2753 au BufEnter,BufLeave,BufNew,WinEnter,WinLeave,WinNew * if winnr('$') > 1 | q | endif
2754 augroup END
2755 ps /
2756
2757 augroup aucmd_win_test
2758 au!
2759 augroup END
2760 endfunc
2761
2740 " vim: shiftwidth=2 sts=2 expandtab 2762 " vim: shiftwidth=2 sts=2 expandtab