mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06: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:
parent
3a573a9e2f
commit
eae90b37c3
@ -1857,6 +1857,26 @@ func Test_FileChangedShell_reload()
|
||||
call delete('Xchanged')
|
||||
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
|
||||
func Test_autocmd_FileReadCmd()
|
||||
func ReadFileCmd()
|
||||
|
Loading…
Reference in New Issue
Block a user