vim-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 vim/vim#5066)
cfb381421f

vim-patch:8.2.3804: script context not set when copying 'swf' and 'ts'

Problem:    Script context not set when copying 'swf' and 'ts'.
Solution:   Use COPY_OPT_SCTX with the right argument. (closes vim/vim#9347)
6206877c51
This commit is contained in:
zeertzjq
2022-02-13 05:40:13 +08:00
parent 90a43e846d
commit dc415ce298
2 changed files with 119 additions and 11 deletions

View File

@@ -314,21 +314,50 @@ func Test_set_errors()
set modifiable&
endfunc
func CheckWasSet(name)
let verb_cm = execute('verbose set ' .. a:name .. '?')
call assert_match('Last set from.*test_options.vim', verb_cm)
endfunc
func CheckWasNotSet(name)
let verb_cm = execute('verbose set ' .. a:name .. '?')
call assert_notmatch('Last set from', verb_cm)
endfunc
" Must be executed before other tests that set 'term'.
func Test_000_term_option_verbose()
if has('nvim') || has('gui_running')
return
endif
let verb_cm = execute('verbose set t_cm')
call assert_notmatch('Last set from', verb_cm)
call CheckWasNotSet('t_cm')
let term_save = &term
set term=ansi
let verb_cm = execute('verbose set t_cm')
call assert_match('Last set from.*test_options.vim', verb_cm)
call CheckWasSet('t_cm')
let &term = term_save
endfunc
func Test_copy_context()
setlocal list
call CheckWasSet('list')
split
call CheckWasSet('list')
quit
setlocal nolist
set ai
call CheckWasSet('ai')
set filetype=perl
call CheckWasSet('filetype')
set fo=tcroq
call CheckWasSet('fo')
split Xsomebuf
call CheckWasSet('ai')
call CheckWasNotSet('filetype')
call CheckWasSet('fo')
endfunc
func Test_set_ttytype()
" Nvim does not support 'ttytype'.
if !has('nvim') && !has('gui_running') && has('unix')