From bfe029a11deaa923980400bcfc3e043136474759 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 25 Jun 2018 19:32:35 -0400 Subject: vim-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 vim/vim#1734) https://github.com/vim/vim/commit/1814183b865059679f6ee526ec23fc575e536e66 --- src/nvim/testdir/test_quickfix.vim | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_quickfix.vim') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 85f93cf3da..646245f857 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -2172,7 +2172,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 @@ -2209,3 +2209,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 -- cgit From 33eb5833b2baefce3797f4544bc1567d0c23c9e7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 25 Jun 2018 19:42:55 -0400 Subject: vim-patch:8.0.0688: cannot resize the window in a FileType autocommand Problem: Cannot resize the window in a FileType autocommand. (Ingo Karkat) Solution: Add the CMDWIN flag to :resize. (test by Ingo Karkat, closes vim/vim#1804) https://github.com/vim/vim/commit/9c4fefffb65a2ed9b4a5b0f1bde0da8f349470b5 --- src/nvim/testdir/test_quickfix.vim | 41 +++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'src/nvim/testdir/test_quickfix.vim') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 646245f857..8d2c61f6f0 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -2169,18 +2169,6 @@ func Test_bufoverflow() set efm&vim endfunc -func Test_cclose_from_copen() - augroup QF_Test - au! - au FileType qf :call assert_fails(':cclose', 'E788') - augroup END - copen - augroup QF_Test - au! - augroup END - augroup! QF_Test -endfunc - " Tests for getting the quickfix stack size func XsizeTests(cchar) call s:setup_commands(a:cchar) @@ -2210,6 +2198,18 @@ func Test_Qf_Size() call XsizeTests('l') endfunc +func Test_cclose_from_copen() + augroup QF_Test + au! + au FileType qf :call assert_fails(':cclose', 'E788') + augroup END + copen + augroup QF_Test + au! + augroup END + augroup! QF_Test +endfunc + func Test_cclose_in_autocmd() " Problem is only triggered if "starting" is zero, so that the OptionsSet " event will be triggered. @@ -2225,3 +2225,20 @@ func Test_cclose_in_autocmd() augroup! QF_Test " call test_override('starting', 0) endfunc + +func Test_resize_from_copen() + augroup QF_Test + au! + au FileType qf resize 5 + augroup END + try + " This should succeed without any exception. No other buffers are + " involved in the autocmd. + copen + finally + augroup QF_Test + au! + augroup END + augroup! QF_Test + endtry +endfunc -- cgit