From e005b8d2eb0d5967d46cae604e3fac0ccae37555 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 1 Apr 2024 05:39:52 +0800 Subject: vim-patch:9.1.0230: TextChanged autocommand not triggered under some circumstances (#28135) Problem: TextChanged autocommand not triggered under some circumstances (Sergey Vlasov) Solution: Trigger TextChanged when TextChangedI has not been triggered fixes: vim/vim#14332 closes: vim/vim#14339 https://github.com/vim/vim/commit/86032702932995db74fed265ba99ae0c823cb75d Co-authored-by: Christian Brabandt --- test/old/testdir/test_autocmd.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/old') diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim index f1040b4b35..9dbd4ac521 100644 --- a/test/old/testdir/test_autocmd.vim +++ b/test/old/testdir/test_autocmd.vim @@ -3957,4 +3957,24 @@ func Test_implicit_session() call delete(expected) endfunc +" Test TextChangedI and TextChanged +func Test_Changed_ChangedI_2() + CheckRunVimInTerminal + call writefile(['one', 'two', 'three'], 'XTextChangedI2', 'D') + let before =<< trim END + autocmd TextChanged,TextChangedI * call writefile([b:changedtick], 'XTextChangedI3') + nnoremap o + call writefile([], 'XTextChangedI3') + END + + call writefile(before, 'Xinit', 'D') + let buf = RunVimInTerminal('-S Xinit XtextChangedI2', {}) + call term_sendkeys(buf, "\") + call term_wait(buf) + call StopVimInTerminal(buf) + call assert_equal(['4'], readfile('XTextChangedI3')) + + call delete('XTextChangedI3') +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit