Mercurial > vim
diff src/testdir/test_quickfix.vim @ 11589:39787def24bb v8.0.0677
patch 8.0.0677: setting 'filetype' may switch buffers
commit https://github.com/vim/vim/commit/1814183b865059679f6ee526ec23fc575e536e66
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 25 21:17:25 2017 +0200
patch 8.0.0677: setting 'filetype' may switch buffers
Problem: Setting 'filetype' internally may cause the current buffer and
window to change unexpectedly.
Solution: Set curbuf_lock. (closes #1734)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 25 Jun 2017 21:30:04 +0200 |
parents | f5add45f9848 |
children | 6f11697fb92c |
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -2190,7 +2190,7 @@ endfunc func Test_cclose_from_copen() augroup QF_Test au! - au FileType qf :cclose + au FileType qf :call assert_fails(':cclose', 'E788') augroup END copen augroup QF_Test @@ -2227,3 +2227,19 @@ func Test_Qf_Size() call XsizeTests('c') call XsizeTests('l') endfunc + +func Test_cclose_in_autocmd() + " Problem is only triggered if "starting" is zero, so that the OptionsSet + " event will be triggered. + call test_override('starting', 1) + augroup QF_Test + au! + au FileType qf :call assert_fails(':cclose', 'E788') + augroup END + copen + augroup QF_Test + au! + augroup END + augroup! QF_Test + call test_override('starting', 0) +endfunc