comparison src/testdir/test_quickfix.vim @ 11611:9dc041e1c8c9 v8.0.0688

patch 8.0.0688: cannot resize the window in a FileType autocommand commit https://github.com/vim/vim/commit/9c4fefffb65a2ed9b4a5b0f1bde0da8f349470b5 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 28 22:26:54 2017 +0200 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 #1804)
author Christian Brabandt <cb@256bit.org>
date Wed, 28 Jun 2017 22:30:03 +0200
parents 6f11697fb92c
children c43118ecb0a3
comparison
equal deleted inserted replaced
11610:6693f32ec213 11611:9dc041e1c8c9
2188 cgetexpr ['Entering directory ' . repeat('a', 1006), 2188 cgetexpr ['Entering directory ' . repeat('a', 1006),
2189 \ 'File1:10:Hello World'] 2189 \ 'File1:10:Hello World']
2190 set efm&vim 2190 set efm&vim
2191 endfunc 2191 endfunc
2192 2192
2193 " Tests for getting the quickfix stack size
2194 func XsizeTests(cchar)
2195 call s:setup_commands(a:cchar)
2196
2197 call g:Xsetlist([], 'f')
2198 call assert_equal(0, g:Xgetlist({'nr':'$'}).nr)
2199 call assert_equal(1, len(g:Xgetlist({'nr':'$', 'all':1})))
2200 call assert_equal(0, len(g:Xgetlist({'nr':0})))
2201
2202 Xexpr "File1:10:Line1"
2203 Xexpr "File2:20:Line2"
2204 Xexpr "File3:30:Line3"
2205 Xolder | Xolder
2206 call assert_equal(3, g:Xgetlist({'nr':'$'}).nr)
2207 call g:Xsetlist([], 'f')
2208
2209 Xexpr "File1:10:Line1"
2210 Xexpr "File2:20:Line2"
2211 Xexpr "File3:30:Line3"
2212 Xolder | Xolder
2213 call g:Xsetlist([], 'a', {'nr':'$', 'title':'Compiler'})
2214 call assert_equal('Compiler', g:Xgetlist({'nr':3, 'all':1}).title)
2215 endfunc
2216
2217 func Test_Qf_Size()
2218 call XsizeTests('c')
2219 call XsizeTests('l')
2220 endfunc
2221
2193 func Test_cclose_from_copen() 2222 func Test_cclose_from_copen()
2194 augroup QF_Test 2223 augroup QF_Test
2195 au! 2224 au!
2196 au FileType qf :call assert_fails(':cclose', 'E788') 2225 au FileType qf :call assert_fails(':cclose', 'E788')
2197 augroup END 2226 augroup END
2198 copen 2227 copen
2199 augroup QF_Test 2228 augroup QF_Test
2200 au! 2229 au!
2201 augroup END 2230 augroup END
2202 augroup! QF_Test 2231 augroup! QF_Test
2203 endfunc
2204
2205 " Tests for getting the quickfix stack size
2206 func XsizeTests(cchar)
2207 call s:setup_commands(a:cchar)
2208
2209 call g:Xsetlist([], 'f')
2210 call assert_equal(0, g:Xgetlist({'nr':'$'}).nr)
2211 call assert_equal(1, len(g:Xgetlist({'nr':'$', 'all':1})))
2212 call assert_equal(0, len(g:Xgetlist({'nr':0})))
2213
2214 Xexpr "File1:10:Line1"
2215 Xexpr "File2:20:Line2"
2216 Xexpr "File3:30:Line3"
2217 Xolder | Xolder
2218 call assert_equal(3, g:Xgetlist({'nr':'$'}).nr)
2219 call g:Xsetlist([], 'f')
2220
2221 Xexpr "File1:10:Line1"
2222 Xexpr "File2:20:Line2"
2223 Xexpr "File3:30:Line3"
2224 Xolder | Xolder
2225 call g:Xsetlist([], 'a', {'nr':'$', 'title':'Compiler'})
2226 call assert_equal('Compiler', g:Xgetlist({'nr':3, 'all':1}).title)
2227 endfunc
2228
2229 func Test_Qf_Size()
2230 call XsizeTests('c')
2231 call XsizeTests('l')
2232 endfunc 2232 endfunc
2233 2233
2234 func Test_cclose_in_autocmd() 2234 func Test_cclose_in_autocmd()
2235 " Problem is only triggered if "starting" is zero, so that the OptionsSet 2235 " Problem is only triggered if "starting" is zero, so that the OptionsSet
2236 " event will be triggered. 2236 " event will be triggered.
2244 au! 2244 au!
2245 augroup END 2245 augroup END
2246 augroup! QF_Test 2246 augroup! QF_Test
2247 call test_override('starting', 0) 2247 call test_override('starting', 0)
2248 endfunc 2248 endfunc
2249
2250 func Test_resize_from_copen()
2251 augroup QF_Test
2252 au!
2253 au FileType qf resize 5
2254 augroup END
2255 try
2256 " This should succeed without any exception. No other buffers are
2257 " involved in the autocmd.
2258 copen
2259 finally
2260 augroup QF_Test
2261 au!
2262 augroup END
2263 augroup! QF_Test
2264 endtry
2265 endfunc