aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/option.c1
-rw-r--r--test/old/testdir/test_options.vim104
2 files changed, 104 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 7d705b8502..a977fc4f86 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -4663,6 +4663,7 @@ void copy_winopt(winopt_T *from, winopt_T *to)
to->wo_briopt = copy_option_val(from->wo_briopt);
to->wo_scb = from->wo_scb;
to->wo_scb_save = from->wo_scb_save;
+ to->wo_sms = from->wo_sms;
to->wo_crb = from->wo_crb;
to->wo_crb_save = from->wo_crb_save;
to->wo_spell = from->wo_spell;
diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim
index f101f550d1..8fc86a99e3 100644
--- a/test/old/testdir/test_options.vim
+++ b/test/old/testdir/test_options.vim
@@ -721,7 +721,7 @@ func Test_backupskip()
let &backupskip = backupskip
endfunc
-func Test_copy_winopt()
+func Test_buf_copy_winopt()
set hidden
" Test copy option from current buffer in window
@@ -775,6 +775,108 @@ func Test_copy_winopt()
set hidden&
endfunc
+func Test_split_copy_options()
+ let values = [
+ \['cursorbind', 1, 0],
+ \['fillchars', '"vert:-"', '"' .. &fillchars .. '"'],
+ \['list', 1, 0],
+ \['listchars', '"space:-"', '"' .. &listchars .. '"'],
+ \['number', 1, 0],
+ \['relativenumber', 1, 0],
+ \['scrollbind', 1, 0],
+ \['smoothscroll', 1, 0],
+ \['virtualedit', '"block"', '"' .. &virtualedit .. '"'],
+ "\ ['wincolor', '"Search"', '"' .. &wincolor .. '"'],
+ \['wrap', 0, 1],
+ \]
+ if has('linebreak')
+ let values += [
+ \['breakindent', 1, 0],
+ \['breakindentopt', '"min:5"', '"' .. &breakindentopt .. '"'],
+ \['linebreak', 1, 0],
+ \['numberwidth', 7, 4],
+ \['showbreak', '"++"', '"' .. &showbreak .. '"'],
+ \]
+ endif
+ if has('rightleft')
+ let values += [
+ \['rightleft', 1, 0],
+ \['rightleftcmd', '"search"', '"' .. &rightleftcmd .. '"'],
+ \]
+ endif
+ if has('statusline')
+ let values += [
+ \['statusline', '"---%f---"', '"' .. &statusline .. '"'],
+ \]
+ endif
+ if has('spell')
+ let values += [
+ \['spell', 1, 0],
+ \]
+ endif
+ if has('syntax')
+ let values += [
+ \['cursorcolumn', 1, 0],
+ \['cursorline', 1, 0],
+ \['cursorlineopt', '"screenline"', '"' .. &cursorlineopt .. '"'],
+ \['colorcolumn', '"+1"', '"' .. &colorcolumn .. '"'],
+ \]
+ endif
+ if has('diff')
+ let values += [
+ \['diff', 1, 0],
+ \]
+ endif
+ if has('conceal')
+ let values += [
+ \['concealcursor', '"nv"', '"' .. &concealcursor .. '"'],
+ \['conceallevel', '3', &conceallevel],
+ \]
+ endif
+ if has('terminal')
+ let values += [
+ \['termwinkey', '"<C-X>"', '"' .. &termwinkey .. '"'],
+ \['termwinsize', '"10x20"', '"' .. &termwinsize .. '"'],
+ \]
+ endif
+ if has('folding')
+ let values += [
+ \['foldcolumn', '"5"', &foldcolumn],
+ \['foldenable', 0, 1],
+ \['foldexpr', '"2 + 3"', '"' .. &foldexpr .. '"'],
+ \['foldignore', '"+="', '"' .. &foldignore .. '"'],
+ \['foldlevel', 4, &foldlevel],
+ \['foldmarker', '">>,<<"', '"' .. &foldmarker .. '"'],
+ \['foldmethod', '"marker"', '"' .. &foldmethod .. '"'],
+ \['foldminlines', 3, &foldminlines],
+ \['foldnestmax', 17, &foldnestmax],
+ \['foldtext', '"closed"', '"' .. &foldtext .. '"'],
+ \]
+ endif
+ if has('signs')
+ let values += [
+ \['signcolumn', '"number"', '"' .. &signcolumn .. '"'],
+ \]
+ endif
+
+ " set options to non-default value
+ for item in values
+ exe $"let &{item[0]} = {item[1]}"
+ endfor
+
+ " check values are set in new window
+ split
+ for item in values
+ exe $'call assert_equal({item[1]}, &{item[0]}, "{item[0]}")'
+ endfor
+
+ " restore
+ close
+ for item in values
+ exe $"let &{item[0]} = {item[1]}"
+ endfor
+endfunc
+
func Test_shortmess_F()
new
call assert_match('\[No Name\]', execute('file'))