comparison src/testdir/test_options.vim @ 18380:212284f893d5 v8.1.2184

patch 8.1.2184: option context is not copied when splitting a window Commit: https://github.com/vim/vim/commit/cfb381421f8be7d6cb4e7dac5b827b23467d3e53 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 19 20:18:47 2019 +0200 patch 8.1.2184: option context is not copied when splitting a window Problem: Option context is not copied when splitting a window. (Daniel Hahler) Solution: Copy the option context, so that ":verbose set" works. (closes #5066)
author Bram Moolenaar <Bram@vim.org>
date Sat, 19 Oct 2019 20:30:04 +0200
parents 8a2fb21c23c0
children bf8eb950df61
comparison
equal deleted inserted replaced
18379:0588431c7018 18380:212284f893d5
294 call assert_fails('set winminwidth=10 winwidth=9', 'E592:') 294 call assert_fails('set winminwidth=10 winwidth=9', 'E592:')
295 call assert_fails("set showbreak=\x01", 'E595:') 295 call assert_fails("set showbreak=\x01", 'E595:')
296 call assert_fails('set t_foo=', 'E846:') 296 call assert_fails('set t_foo=', 'E846:')
297 endfunc 297 endfunc
298 298
299 func CheckWasSet(name)
300 let verb_cm = execute('verbose set ' .. a:name .. '?')
301 call assert_match('Last set from.*test_options.vim', verb_cm)
302 endfunc
303 func CheckWasNotSet(name)
304 let verb_cm = execute('verbose set ' .. a:name .. '?')
305 call assert_notmatch('Last set from', verb_cm)
306 endfunc
307
299 " Must be executed before other tests that set 'term'. 308 " Must be executed before other tests that set 'term'.
300 func Test_000_term_option_verbose() 309 func Test_000_term_option_verbose()
301 CheckNotGui 310 CheckNotGui
302 311
303 let verb_cm = execute('verbose set t_cm') 312 call CheckWasNotSet('t_cm')
304 call assert_notmatch('Last set from', verb_cm)
305 313
306 let term_save = &term 314 let term_save = &term
307 set term=ansi 315 set term=ansi
308 let verb_cm = execute('verbose set t_cm') 316 call CheckWasSet('t_cm')
309 call assert_match('Last set from.*test_options.vim', verb_cm)
310 let &term = term_save 317 let &term = term_save
318 endfunc
319
320 func Test_copy_context()
321 setlocal list
322 call CheckWasSet('list')
323 split
324 call CheckWasSet('list')
325 quit
326 setlocal nolist
327
328 set ai
329 call CheckWasSet('ai')
330 set filetype=perl
331 call CheckWasSet('filetype')
332 set fo=tcroq
333 call CheckWasSet('fo')
334
335 split Xsomebuf
336 call CheckWasSet('ai')
337 call CheckWasNotSet('filetype')
338 call CheckWasSet('fo')
311 endfunc 339 endfunc
312 340
313 func Test_set_ttytype() 341 func Test_set_ttytype()
314 CheckUnix 342 CheckUnix
315 CheckNotGui 343 CheckNotGui