mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 9.0.0644: 'smoothscroll' is not copied to a new window on :split
Problem: 'smoothscroll' is not copied to a new window on :split. Solution: Copy the option value. Add a test.
This commit is contained in:
@@ -5679,6 +5679,7 @@ copy_winopt(winopt_T *from, winopt_T *to)
|
||||
to->wo_wcr = copy_option_val(from->wo_wcr);
|
||||
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;
|
||||
#ifdef FEAT_SPELL
|
||||
|
@@ -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
|
||||
|
||||
def Test_split_copy_options()
|
||||
var values = [
|
||||
['cursorbind', true, false],
|
||||
['fillchars', '"vert:-"', '"' .. &fillchars .. '"'],
|
||||
['list', true, 0],
|
||||
['listchars', '"space:-"', '"' .. &listchars .. '"'],
|
||||
['number', true, 0],
|
||||
['relativenumber', true, false],
|
||||
['scrollbind', true, false],
|
||||
['smoothscroll', true, false],
|
||||
['virtualedit', '"block"', '"' .. &virtualedit .. '"'],
|
||||
['wincolor', '"Search"', '"' .. &wincolor .. '"'],
|
||||
['wrap', false, true],
|
||||
]
|
||||
if has('linebreak')
|
||||
values += [
|
||||
['breakindent', true, false],
|
||||
['breakindentopt', '"min:5"', '"' .. &breakindentopt .. '"'],
|
||||
['linebreak', true, false],
|
||||
['numberwidth', 7, 4],
|
||||
['showbreak', '"++"', '"' .. &showbreak .. '"'],
|
||||
]
|
||||
endif
|
||||
if has('rightleft')
|
||||
values += [
|
||||
['rightleft', true, false],
|
||||
['rightleftcmd', '"search"', '"' .. &rightleftcmd .. '"'],
|
||||
]
|
||||
endif
|
||||
if has('statusline')
|
||||
values += [
|
||||
['statusline', '"---%f---"', '"' .. &statusline .. '"'],
|
||||
]
|
||||
endif
|
||||
if has('spell')
|
||||
values += [
|
||||
['spell', true, false],
|
||||
]
|
||||
endif
|
||||
if has('syntax')
|
||||
values += [
|
||||
['cursorcolumn', true, false],
|
||||
['cursorline', true, false],
|
||||
['cursorlineopt', '"screenline"', '"' .. &cursorlineopt .. '"'],
|
||||
['colorcolumn', '"+1"', '"' .. &colorcolumn .. '"'],
|
||||
]
|
||||
endif
|
||||
if has('diff')
|
||||
values += [
|
||||
['diff', true, false],
|
||||
]
|
||||
endif
|
||||
if has('conceal')
|
||||
values += [
|
||||
['concealcursor', '"nv"', '"' .. &concealcursor .. '"'],
|
||||
['conceallevel', '3', &conceallevel],
|
||||
]
|
||||
endif
|
||||
if has('terminal')
|
||||
values += [
|
||||
['termwinkey', '"<C-X>"', '"' .. &termwinkey .. '"'],
|
||||
['termwinsize', '"10x20"', '"' .. &termwinsize .. '"'],
|
||||
]
|
||||
endif
|
||||
if has('folding')
|
||||
values += [
|
||||
['foldcolumn', 5, &foldcolumn],
|
||||
['foldenable', false, true],
|
||||
['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')
|
||||
values += [
|
||||
['signcolumn', '"number"', '"' .. &signcolumn .. '"'],
|
||||
]
|
||||
endif
|
||||
|
||||
# set options to non-default value
|
||||
for item in values
|
||||
exe $'&l:{item[0]} = {item[1]}'
|
||||
endfor
|
||||
|
||||
# check values are set in new window
|
||||
split
|
||||
for item in values
|
||||
exe $'assert_equal({item[1]}, &{item[0]}, "{item[0]}")'
|
||||
endfor
|
||||
|
||||
# restore
|
||||
close
|
||||
for item in values
|
||||
exe $'&l:{item[0]} = {item[2]}'
|
||||
endfor
|
||||
enddef
|
||||
|
||||
func Test_shortmess_F()
|
||||
new
|
||||
call assert_match('\[No Name\]', execute('file'))
|
||||
|
@@ -699,6 +699,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
644,
|
||||
/**/
|
||||
643,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user