diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-19 20:18:47 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-19 20:18:47 +0200 |
commit | cfb381421f8be7d6cb4e7dac5b827b23467d3e53 (patch) | |
tree | 4d396c009ff3ce7fbca8656a1f79752881a03915 /src/testdir/test_options.vim | |
parent | ba089307bb8d18ab79a6c4a28ceb8419a72209b3 (diff) | |
download | vim-git-cfb381421f8be7d6cb4e7dac5b827b23467d3e53.tar.gz |
patch 8.1.2184: option context is not copied when splitting a windowv8.1.2184
Problem: Option context is not copied when splitting a window. (Daniel
Hahler)
Solution: Copy the option context, so that ":verbose set" works.
(closes #5066)
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r-- | src/testdir/test_options.vim | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 3a4335650..65600eea9 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -296,20 +296,48 @@ func Test_set_errors() call assert_fails('set t_foo=', 'E846:') 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() CheckNotGui - 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() CheckUnix CheckNotGui |