mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
vim-patch:8.2.0302: setting 'term' may cause error in TermChanged autocommand
Problem: Setting 'term' may cause error in TermChanged autocommand.
Solution: Use aucmd_prepbuf() to switch to the buffer where the autocommand
is to be executed. (closes vim/vim#5682)
0c81d1b112
This commit is contained in:
@@ -1857,6 +1857,26 @@ func Test_FileChangedShell_reload()
|
|||||||
call delete('Xchanged')
|
call delete('Xchanged')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func LogACmd()
|
||||||
|
call add(g:logged, line('$'))
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_TermChanged()
|
||||||
|
enew!
|
||||||
|
tabnew
|
||||||
|
call setline(1, ['a', 'b', 'c', 'd'])
|
||||||
|
$
|
||||||
|
au TermChanged * call LogACmd()
|
||||||
|
let g:logged = []
|
||||||
|
let term_save = &term
|
||||||
|
set term=xterm
|
||||||
|
call assert_equal([1, 4], g:logged)
|
||||||
|
|
||||||
|
au! TermChanged
|
||||||
|
let &term = term_save
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test for FileReadCmd autocmd
|
" Test for FileReadCmd autocmd
|
||||||
func Test_autocmd_FileReadCmd()
|
func Test_autocmd_FileReadCmd()
|
||||||
func ReadFileCmd()
|
func ReadFileCmd()
|
||||||
|
Reference in New Issue
Block a user