0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.2185: BufUnload is not triggered for the quickfix dummy buffer

Problem:    BufUnload is not triggered for the quickfix dummy buffer.
Solution:   Do trigger BufUnload. (Pontus Leitzler,closes #7518, closes #7517)
            Fix white space around "=".
This commit is contained in:
Bram Moolenaar
2020-12-22 11:40:45 +01:00
parent 9a963377b4
commit 1cfb9bb5c0
2 changed files with 108 additions and 85 deletions

View File

@@ -6513,7 +6513,7 @@ wipe_dummy_buffer(buf_T *buf, char_u *dirname_start)
enter_cleanup(&cs); enter_cleanup(&cs);
#endif #endif
wipe_buffer(buf, FALSE); wipe_buffer(buf, TRUE);
#if defined(FEAT_EVAL) #if defined(FEAT_EVAL)
// Restore the error/interrupt/exception state if not discarded by a // Restore the error/interrupt/exception state if not discarded by a

View File

@@ -132,19 +132,19 @@ func Test_bufunload()
autocmd BufWipeout * call add(s:li, "bufwipeout") autocmd BufWipeout * call add(s:li, "bufwipeout")
augroup END augroup END
let s:li=[] let s:li = []
new new
setlocal bufhidden= setlocal bufhidden=
bunload bunload
call assert_equal(["bufunload", "bufdelete"], s:li) call assert_equal(["bufunload", "bufdelete"], s:li)
let s:li=[] let s:li = []
new new
setlocal bufhidden=delete setlocal bufhidden=delete
bunload bunload
call assert_equal(["bufunload", "bufdelete"], s:li) call assert_equal(["bufunload", "bufdelete"], s:li)
let s:li=[] let s:li = []
new new
setlocal bufhidden=unload setlocal bufhidden=unload
bwipeout bwipeout
@@ -221,6 +221,29 @@ func Test_autocmd_bufunload_avoiding_SEGV_02()
bwipe! a.txt bwipe! a.txt
endfunc endfunc
func Test_autocmd_dummy_wipeout()
" prepare files
call writefile([''], 'Xdummywipetest1.txt')
call writefile([''], 'Xdummywipetest2.txt')
augroup test_bufunload_group
autocmd!
autocmd BufUnload * call add(s:li, "bufunload")
autocmd BufDelete * call add(s:li, "bufdelete")
autocmd BufWipeout * call add(s:li, "bufwipeout")
augroup END
let s:li = []
split Xdummywipetest1.txt
silent! vimgrep /notmatched/ Xdummywipetest*
call assert_equal(["bufunload", "bufwipeout"], s:li)
bwipeout
call delete('Xdummywipetest1.txt')
call delete('Xdummywipetest2.txt')
au! test_bufunload_group
augroup! test_bufunload_group
endfunc
func Test_win_tab_autocmd() func Test_win_tab_autocmd()
let g:record = [] let g:record = []
@@ -454,7 +477,7 @@ func Test_autocmd_bufwipe_in_SessLoadPost()
let content =<< trim [CODE] let content =<< trim [CODE]
call test_override('ui_delay', 10) call test_override('ui_delay', 10)
set nocp noswapfile set nocp noswapfile
let v:swapchoice="e" let v:swapchoice = "e"
augroup test_autocmd_sessionload augroup test_autocmd_sessionload
autocmd! autocmd!
autocmd SessionLoadPost * exe bufnr("Xsomething") . "bw!" autocmd SessionLoadPost * exe bufnr("Xsomething") . "bw!"
@@ -542,43 +565,43 @@ func Test_OptionSet()
au OptionSet * :call s:AutoCommandOptionSet(expand("<amatch>")) au OptionSet * :call s:AutoCommandOptionSet(expand("<amatch>"))
" 1: Setting number option" " 1: Setting number option"
let g:options=[['number', 0, 0, 0, 1, 'global', 'set']] let g:options = [['number', 0, 0, 0, 1, 'global', 'set']]
set nu set nu
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 2: Setting local number option" " 2: Setting local number option"
let g:options=[['number', 1, 1, '', 0, 'local', 'setlocal']] let g:options = [['number', 1, 1, '', 0, 'local', 'setlocal']]
setlocal nonu setlocal nonu
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 3: Setting global number option" " 3: Setting global number option"
let g:options=[['number', 1, '', 1, 0, 'global', 'setglobal']] let g:options = [['number', 1, '', 1, 0, 'global', 'setglobal']]
setglobal nonu setglobal nonu
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 4: Setting local autoindent option" " 4: Setting local autoindent option"
let g:options=[['autoindent', 0, 0, '', 1, 'local', 'setlocal']] let g:options = [['autoindent', 0, 0, '', 1, 'local', 'setlocal']]
setlocal ai setlocal ai
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 5: Setting global autoindent option" " 5: Setting global autoindent option"
let g:options=[['autoindent', 0, '', 0, 1, 'global', 'setglobal']] let g:options = [['autoindent', 0, '', 0, 1, 'global', 'setglobal']]
setglobal ai setglobal ai
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 6: Setting global autoindent option" " 6: Setting global autoindent option"
let g:options=[['autoindent', 1, 1, 1, 0, 'global', 'set']] let g:options = [['autoindent', 1, 1, 1, 0, 'global', 'set']]
set ai! set ai!
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 6a: Setting global autoindent option" " 6a: Setting global autoindent option"
let g:options=[['autoindent', 1, 1, 0, 0, 'global', 'set']] let g:options = [['autoindent', 1, 1, 0, 0, 'global', 'set']]
noa setlocal ai noa setlocal ai
noa setglobal noai noa setglobal noai
set ai! set ai!
@@ -587,55 +610,55 @@ func Test_OptionSet()
" Should not print anything, use :noa " Should not print anything, use :noa
" 7: don't trigger OptionSet" " 7: don't trigger OptionSet"
let g:options=[['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid']] let g:options = [['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid']]
noa set nonu noa set nonu
call assert_equal([['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid']], g:options) call assert_equal([['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid']], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 8: Setting several global list and number option" " 8: Setting several global list and number option"
let g:options=[['list', 0, 0, 0, 1, 'global', 'set'], ['number', 0, 0, 0, 1, 'global', 'set']] let g:options = [['list', 0, 0, 0, 1, 'global', 'set'], ['number', 0, 0, 0, 1, 'global', 'set']]
set list nu set list nu
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 9: don't trigger OptionSet" " 9: don't trigger OptionSet"
let g:options=[['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid'], ['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid']] let g:options = [['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid'], ['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid']]
noa set nolist nonu noa set nolist nonu
call assert_equal([['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid'], ['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid']], g:options) call assert_equal([['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid'], ['invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid', 'invalid']], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 10: Setting global acd" " 10: Setting global acd"
let g:options=[['autochdir', 0, 0, '', 1, 'local', 'setlocal']] let g:options = [['autochdir', 0, 0, '', 1, 'local', 'setlocal']]
setlocal acd setlocal acd
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 11: Setting global autoread (also sets local value)" " 11: Setting global autoread (also sets local value)"
let g:options=[['autoread', 0, 0, 0, 1, 'global', 'set']] let g:options = [['autoread', 0, 0, 0, 1, 'global', 'set']]
set ar set ar
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 12: Setting local autoread" " 12: Setting local autoread"
let g:options=[['autoread', 1, 1, '', 1, 'local', 'setlocal']] let g:options = [['autoread', 1, 1, '', 1, 'local', 'setlocal']]
setlocal ar setlocal ar
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 13: Setting global autoread" " 13: Setting global autoread"
let g:options=[['autoread', 1, '', 1, 0, 'global', 'setglobal']] let g:options = [['autoread', 1, '', 1, 0, 'global', 'setglobal']]
setglobal invar setglobal invar
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 14: Setting option backspace through :let" " 14: Setting option backspace through :let"
let g:options=[['backspace', '', '', '', 'eol,indent,start', 'global', 'set']] let g:options = [['backspace', '', '', '', 'eol,indent,start', 'global', 'set']]
let &bs="eol,indent,start" let &bs = "eol,indent,start"
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 15: Setting option backspace through setbufvar()" " 15: Setting option backspace through setbufvar()"
let g:options=[['backup', 0, 0, '', 1, 'local', 'setlocal']] let g:options = [['backup', 0, 0, '', 1, 'local', 'setlocal']]
" try twice, first time, shouldn't trigger because option name is invalid, " try twice, first time, shouldn't trigger because option name is invalid,
" second time, it should trigger " second time, it should trigger
let bnum = bufnr('%') let bnum = bufnr('%')
@@ -646,13 +669,13 @@ func Test_OptionSet()
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 16: Setting number option using setwinvar" " 16: Setting number option using setwinvar"
let g:options=[['number', 0, 0, '', 1, 'local', 'setlocal']] let g:options = [['number', 0, 0, '', 1, 'local', 'setlocal']]
call setwinvar(0, '&number', 1) call setwinvar(0, '&number', 1)
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 17: Setting key option, shouldn't trigger" " 17: Setting key option, shouldn't trigger"
let g:options=[['key', 'invalid', 'invalid1', 'invalid2', 'invalid3', 'invalid4', 'invalid5']] let g:options = [['key', 'invalid', 'invalid1', 'invalid2', 'invalid3', 'invalid4', 'invalid5']]
setlocal key=blah setlocal key=blah
setlocal key= setlocal key=
call assert_equal([['key', 'invalid', 'invalid1', 'invalid2', 'invalid3', 'invalid4', 'invalid5']], g:options) call assert_equal([['key', 'invalid', 'invalid1', 'invalid2', 'invalid3', 'invalid4', 'invalid5']], g:options)
@@ -661,19 +684,19 @@ func Test_OptionSet()
" 18a: Setting string global option" " 18a: Setting string global option"
let oldval = &backupext let oldval = &backupext
let g:options=[['backupext', oldval, oldval, oldval, 'foo', 'global', 'set']] let g:options = [['backupext', oldval, oldval, oldval, 'foo', 'global', 'set']]
set backupext=foo set backupext=foo
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 18b: Resetting string global option" " 18b: Resetting string global option"
let g:options=[['backupext', 'foo', 'foo', 'foo', oldval, 'global', 'set']] let g:options = [['backupext', 'foo', 'foo', 'foo', oldval, 'global', 'set']]
set backupext& set backupext&
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 18c: Setting global string global option" " 18c: Setting global string global option"
let g:options=[['backupext', oldval, '', oldval, 'bar', 'global', 'setglobal']] let g:options = [['backupext', oldval, '', oldval, 'bar', 'global', 'setglobal']]
setglobal backupext=bar setglobal backupext=bar
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -682,7 +705,7 @@ func Test_OptionSet()
" As this is a global option this sets the global value even though " As this is a global option this sets the global value even though
" :setlocal is used! " :setlocal is used!
noa set backupext& " Reset global and local value (without triggering autocmd) noa set backupext& " Reset global and local value (without triggering autocmd)
let g:options=[['backupext', oldval, oldval, '', 'baz', 'local', 'setlocal']] let g:options = [['backupext', oldval, oldval, '', 'baz', 'local', 'setlocal']]
setlocal backupext=baz setlocal backupext=baz
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -690,7 +713,7 @@ func Test_OptionSet()
" 18e: Setting again string global option" " 18e: Setting again string global option"
noa setglobal backupext=ext_global " Reset global and local value (without triggering autocmd) noa setglobal backupext=ext_global " Reset global and local value (without triggering autocmd)
noa setlocal backupext=ext_local " Sets the global(!) value! noa setlocal backupext=ext_local " Sets the global(!) value!
let g:options=[['backupext', 'ext_local', 'ext_local', 'ext_local', 'fuu', 'global', 'set']] let g:options = [['backupext', 'ext_local', 'ext_local', 'ext_local', 'fuu', 'global', 'set']]
set backupext=fuu set backupext=fuu
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -698,25 +721,25 @@ func Test_OptionSet()
" 19a: Setting string local-global (to buffer) option" " 19a: Setting string local-global (to buffer) option"
let oldval = &tags let oldval = &tags
let g:options=[['tags', oldval, oldval, oldval, 'tagpath', 'global', 'set']] let g:options = [['tags', oldval, oldval, oldval, 'tagpath', 'global', 'set']]
set tags=tagpath set tags=tagpath
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 19b: Resetting string local-global (to buffer) option" " 19b: Resetting string local-global (to buffer) option"
let g:options=[['tags', 'tagpath', 'tagpath', 'tagpath', oldval, 'global', 'set']] let g:options = [['tags', 'tagpath', 'tagpath', 'tagpath', oldval, 'global', 'set']]
set tags& set tags&
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 19c: Setting global string local-global (to buffer) option " " 19c: Setting global string local-global (to buffer) option "
let g:options=[['tags', oldval, '', oldval, 'tagpath1', 'global', 'setglobal']] let g:options = [['tags', oldval, '', oldval, 'tagpath1', 'global', 'setglobal']]
setglobal tags=tagpath1 setglobal tags=tagpath1
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 19d: Setting local string local-global (to buffer) option" " 19d: Setting local string local-global (to buffer) option"
let g:options=[['tags', 'tagpath1', 'tagpath1', '', 'tagpath2', 'local', 'setlocal']] let g:options = [['tags', 'tagpath1', 'tagpath1', '', 'tagpath2', 'local', 'setlocal']]
setlocal tags=tagpath2 setlocal tags=tagpath2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -726,7 +749,7 @@ func Test_OptionSet()
" but the old local value for all other kinds of options. " but the old local value for all other kinds of options.
noa setglobal tags=tag_global " Reset global and local value (without triggering autocmd) noa setglobal tags=tag_global " Reset global and local value (without triggering autocmd)
noa setlocal tags=tag_local noa setlocal tags=tag_local
let g:options=[['tags', 'tag_global', 'tag_local', 'tag_global', 'tagpath', 'global', 'set']] let g:options = [['tags', 'tag_global', 'tag_local', 'tag_global', 'tagpath', 'global', 'set']]
set tags=tagpath set tags=tagpath
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -736,7 +759,7 @@ func Test_OptionSet()
" but the old local value for all other kinds of options. " but the old local value for all other kinds of options.
noa set tags=tag_global " Reset global and local value (without triggering autocmd) noa set tags=tag_global " Reset global and local value (without triggering autocmd)
noa setlocal tags= " empty string noa setlocal tags= " empty string
let g:options=[['tags', 'tag_global', '', 'tag_global', 'tagpath', 'global', 'set']] let g:options = [['tags', 'tag_global', '', 'tag_global', 'tagpath', 'global', 'set']]
set tags=tagpath set tags=tagpath
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -744,26 +767,26 @@ func Test_OptionSet()
" 20a: Setting string local (to buffer) option" " 20a: Setting string local (to buffer) option"
let oldval = &spelllang let oldval = &spelllang
let g:options=[['spelllang', oldval, oldval, oldval, 'elvish,klingon', 'global', 'set']] let g:options = [['spelllang', oldval, oldval, oldval, 'elvish,klingon', 'global', 'set']]
set spelllang=elvish,klingon set spelllang=elvish,klingon
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 20b: Resetting string local (to buffer) option" " 20b: Resetting string local (to buffer) option"
let g:options=[['spelllang', 'elvish,klingon', 'elvish,klingon', 'elvish,klingon', oldval, 'global', 'set']] let g:options = [['spelllang', 'elvish,klingon', 'elvish,klingon', 'elvish,klingon', oldval, 'global', 'set']]
set spelllang& set spelllang&
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 20c: Setting global string local (to buffer) option" " 20c: Setting global string local (to buffer) option"
let g:options=[['spelllang', oldval, '', oldval, 'elvish', 'global', 'setglobal']] let g:options = [['spelllang', oldval, '', oldval, 'elvish', 'global', 'setglobal']]
setglobal spelllang=elvish setglobal spelllang=elvish
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 20d: Setting local string local (to buffer) option" " 20d: Setting local string local (to buffer) option"
noa set spelllang& " Reset global and local value (without triggering autocmd) noa set spelllang& " Reset global and local value (without triggering autocmd)
let g:options=[['spelllang', oldval, oldval, '', 'klingon', 'local', 'setlocal']] let g:options = [['spelllang', oldval, oldval, '', 'klingon', 'local', 'setlocal']]
setlocal spelllang=klingon setlocal spelllang=klingon
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -773,7 +796,7 @@ func Test_OptionSet()
" but the old local value for all other kinds of options. " but the old local value for all other kinds of options.
noa setglobal spelllang=spellglobal " Reset global and local value (without triggering autocmd) noa setglobal spelllang=spellglobal " Reset global and local value (without triggering autocmd)
noa setlocal spelllang=spelllocal noa setlocal spelllang=spelllocal
let g:options=[['spelllang', 'spelllocal', 'spelllocal', 'spellglobal', 'foo', 'global', 'set']] let g:options = [['spelllang', 'spelllocal', 'spelllocal', 'spellglobal', 'foo', 'global', 'set']]
set spelllang=foo set spelllang=foo
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -781,7 +804,7 @@ func Test_OptionSet()
" 21a: Setting string local-global (to window) option" " 21a: Setting string local-global (to window) option"
let oldval = &statusline let oldval = &statusline
let g:options=[['statusline', oldval, oldval, oldval, 'foo', 'global', 'set']] let g:options = [['statusline', oldval, oldval, oldval, 'foo', 'global', 'set']]
set statusline=foo set statusline=foo
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -789,20 +812,20 @@ func Test_OptionSet()
" 21b: Resetting string local-global (to window) option" " 21b: Resetting string local-global (to window) option"
" Note: v:option_old is the old global value for local-global string options " Note: v:option_old is the old global value for local-global string options
" but the old local value for all other kinds of options. " but the old local value for all other kinds of options.
let g:options=[['statusline', 'foo', 'foo', 'foo', oldval, 'global', 'set']] let g:options = [['statusline', 'foo', 'foo', 'foo', oldval, 'global', 'set']]
set statusline& set statusline&
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 21c: Setting global string local-global (to window) option" " 21c: Setting global string local-global (to window) option"
let g:options=[['statusline', oldval, '', oldval, 'bar', 'global', 'setglobal']] let g:options = [['statusline', oldval, '', oldval, 'bar', 'global', 'setglobal']]
setglobal statusline=bar setglobal statusline=bar
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 21d: Setting local string local-global (to window) option" " 21d: Setting local string local-global (to window) option"
noa set statusline& " Reset global and local value (without triggering autocmd) noa set statusline& " Reset global and local value (without triggering autocmd)
let g:options=[['statusline', oldval, oldval, '', 'baz', 'local', 'setlocal']] let g:options = [['statusline', oldval, oldval, '', 'baz', 'local', 'setlocal']]
setlocal statusline=baz setlocal statusline=baz
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -812,7 +835,7 @@ func Test_OptionSet()
" but the old local value for all other kinds of options. " but the old local value for all other kinds of options.
noa setglobal statusline=bar " Reset global and local value (without triggering autocmd) noa setglobal statusline=bar " Reset global and local value (without triggering autocmd)
noa setlocal statusline=baz noa setlocal statusline=baz
let g:options=[['statusline', 'bar', 'baz', 'bar', 'foo', 'global', 'set']] let g:options = [['statusline', 'bar', 'baz', 'bar', 'foo', 'global', 'set']]
set statusline=foo set statusline=foo
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -820,26 +843,26 @@ func Test_OptionSet()
" 22a: Setting string local (to window) option" " 22a: Setting string local (to window) option"
let oldval = &foldignore let oldval = &foldignore
let g:options=[['foldignore', oldval, oldval, oldval, 'fo', 'global', 'set']] let g:options = [['foldignore', oldval, oldval, oldval, 'fo', 'global', 'set']]
set foldignore=fo set foldignore=fo
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 22b: Resetting string local (to window) option" " 22b: Resetting string local (to window) option"
let g:options=[['foldignore', 'fo', 'fo', 'fo', oldval, 'global', 'set']] let g:options = [['foldignore', 'fo', 'fo', 'fo', oldval, 'global', 'set']]
set foldignore& set foldignore&
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 22c: Setting global string local (to window) option" " 22c: Setting global string local (to window) option"
let g:options=[['foldignore', oldval, '', oldval, 'bar', 'global', 'setglobal']] let g:options = [['foldignore', oldval, '', oldval, 'bar', 'global', 'setglobal']]
setglobal foldignore=bar setglobal foldignore=bar
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 22d: Setting local string local (to window) option" " 22d: Setting local string local (to window) option"
noa set foldignore& " Reset global and local value (without triggering autocmd) noa set foldignore& " Reset global and local value (without triggering autocmd)
let g:options=[['foldignore', oldval, oldval, '', 'baz', 'local', 'setlocal']] let g:options = [['foldignore', oldval, oldval, '', 'baz', 'local', 'setlocal']]
setlocal foldignore=baz setlocal foldignore=baz
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -847,7 +870,7 @@ func Test_OptionSet()
" 22e: Setting again string local (to window) option" " 22e: Setting again string local (to window) option"
noa setglobal foldignore=glob " Reset global and local value (without triggering autocmd) noa setglobal foldignore=glob " Reset global and local value (without triggering autocmd)
noa setlocal foldignore=loc noa setlocal foldignore=loc
let g:options=[['foldignore', 'loc', 'loc', 'glob', 'fo', 'global', 'set']] let g:options = [['foldignore', 'loc', 'loc', 'glob', 'fo', 'global', 'set']]
set foldignore=fo set foldignore=fo
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -856,7 +879,7 @@ func Test_OptionSet()
" 23a: Setting global number local option" " 23a: Setting global number local option"
noa setglobal cmdheight=8 " Reset global and local value (without triggering autocmd) noa setglobal cmdheight=8 " Reset global and local value (without triggering autocmd)
noa setlocal cmdheight=1 " Sets the global(!) value! noa setlocal cmdheight=1 " Sets the global(!) value!
let g:options=[['cmdheight', '1', '', '1', '2', 'global', 'setglobal']] let g:options = [['cmdheight', '1', '', '1', '2', 'global', 'setglobal']]
setglobal cmdheight=2 setglobal cmdheight=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -864,7 +887,7 @@ func Test_OptionSet()
" 23b: Setting local number global option" " 23b: Setting local number global option"
noa setglobal cmdheight=8 " Reset global and local value (without triggering autocmd) noa setglobal cmdheight=8 " Reset global and local value (without triggering autocmd)
noa setlocal cmdheight=1 " Sets the global(!) value! noa setlocal cmdheight=1 " Sets the global(!) value!
let g:options=[['cmdheight', '1', '1', '', '2', 'local', 'setlocal']] let g:options = [['cmdheight', '1', '1', '', '2', 'local', 'setlocal']]
setlocal cmdheight=2 setlocal cmdheight=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -872,14 +895,14 @@ func Test_OptionSet()
" 23c: Setting again number global option" " 23c: Setting again number global option"
noa setglobal cmdheight=8 " Reset global and local value (without triggering autocmd) noa setglobal cmdheight=8 " Reset global and local value (without triggering autocmd)
noa setlocal cmdheight=1 " Sets the global(!) value! noa setlocal cmdheight=1 " Sets the global(!) value!
let g:options=[['cmdheight', '1', '1', '1', '2', 'global', 'set']] let g:options = [['cmdheight', '1', '1', '1', '2', 'global', 'set']]
set cmdheight=2 set cmdheight=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 23d: Setting again number global option" " 23d: Setting again number global option"
noa set cmdheight=8 " Reset global and local value (without triggering autocmd) noa set cmdheight=8 " Reset global and local value (without triggering autocmd)
let g:options=[['cmdheight', '8', '8', '8', '2', 'global', 'set']] let g:options = [['cmdheight', '8', '8', '8', '2', 'global', 'set']]
set cmdheight=2 set cmdheight=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -888,7 +911,7 @@ func Test_OptionSet()
" 24a: Setting global number global-local (to buffer) option" " 24a: Setting global number global-local (to buffer) option"
noa setglobal undolevels=8 " Reset global and local value (without triggering autocmd) noa setglobal undolevels=8 " Reset global and local value (without triggering autocmd)
noa setlocal undolevels=1 noa setlocal undolevels=1
let g:options=[['undolevels', '8', '', '8', '2', 'global', 'setglobal']] let g:options = [['undolevels', '8', '', '8', '2', 'global', 'setglobal']]
setglobal undolevels=2 setglobal undolevels=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -896,7 +919,7 @@ func Test_OptionSet()
" 24b: Setting local number global-local (to buffer) option" " 24b: Setting local number global-local (to buffer) option"
noa setglobal undolevels=8 " Reset global and local value (without triggering autocmd) noa setglobal undolevels=8 " Reset global and local value (without triggering autocmd)
noa setlocal undolevels=1 noa setlocal undolevels=1
let g:options=[['undolevels', '1', '1', '', '2', 'local', 'setlocal']] let g:options = [['undolevels', '1', '1', '', '2', 'local', 'setlocal']]
setlocal undolevels=2 setlocal undolevels=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -904,14 +927,14 @@ func Test_OptionSet()
" 24c: Setting again number global-local (to buffer) option" " 24c: Setting again number global-local (to buffer) option"
noa setglobal undolevels=8 " Reset global and local value (without triggering autocmd) noa setglobal undolevels=8 " Reset global and local value (without triggering autocmd)
noa setlocal undolevels=1 noa setlocal undolevels=1
let g:options=[['undolevels', '1', '1', '8', '2', 'global', 'set']] let g:options = [['undolevels', '1', '1', '8', '2', 'global', 'set']]
set undolevels=2 set undolevels=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 24d: Setting again global number global-local (to buffer) option" " 24d: Setting again global number global-local (to buffer) option"
noa set undolevels=8 " Reset global and local value (without triggering autocmd) noa set undolevels=8 " Reset global and local value (without triggering autocmd)
let g:options=[['undolevels', '8', '8', '8', '2', 'global', 'set']] let g:options = [['undolevels', '8', '8', '8', '2', 'global', 'set']]
set undolevels=2 set undolevels=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -920,7 +943,7 @@ func Test_OptionSet()
" 25a: Setting global number local (to buffer) option" " 25a: Setting global number local (to buffer) option"
noa setglobal wrapmargin=8 " Reset global and local value (without triggering autocmd) noa setglobal wrapmargin=8 " Reset global and local value (without triggering autocmd)
noa setlocal wrapmargin=1 noa setlocal wrapmargin=1
let g:options=[['wrapmargin', '8', '', '8', '2', 'global', 'setglobal']] let g:options = [['wrapmargin', '8', '', '8', '2', 'global', 'setglobal']]
setglobal wrapmargin=2 setglobal wrapmargin=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -928,7 +951,7 @@ func Test_OptionSet()
" 25b: Setting local number local (to buffer) option" " 25b: Setting local number local (to buffer) option"
noa setglobal wrapmargin=8 " Reset global and local value (without triggering autocmd) noa setglobal wrapmargin=8 " Reset global and local value (without triggering autocmd)
noa setlocal wrapmargin=1 noa setlocal wrapmargin=1
let g:options=[['wrapmargin', '1', '1', '', '2', 'local', 'setlocal']] let g:options = [['wrapmargin', '1', '1', '', '2', 'local', 'setlocal']]
setlocal wrapmargin=2 setlocal wrapmargin=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -936,14 +959,14 @@ func Test_OptionSet()
" 25c: Setting again number local (to buffer) option" " 25c: Setting again number local (to buffer) option"
noa setglobal wrapmargin=8 " Reset global and local value (without triggering autocmd) noa setglobal wrapmargin=8 " Reset global and local value (without triggering autocmd)
noa setlocal wrapmargin=1 noa setlocal wrapmargin=1
let g:options=[['wrapmargin', '1', '1', '8', '2', 'global', 'set']] let g:options = [['wrapmargin', '1', '1', '8', '2', 'global', 'set']]
set wrapmargin=2 set wrapmargin=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 25d: Setting again global number local (to buffer) option" " 25d: Setting again global number local (to buffer) option"
noa set wrapmargin=8 " Reset global and local value (without triggering autocmd) noa set wrapmargin=8 " Reset global and local value (without triggering autocmd)
let g:options=[['wrapmargin', '8', '8', '8', '2', 'global', 'set']] let g:options = [['wrapmargin', '8', '8', '8', '2', 'global', 'set']]
set wrapmargin=2 set wrapmargin=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -956,7 +979,7 @@ func Test_OptionSet()
" 27a: Setting global number local (to window) option" " 27a: Setting global number local (to window) option"
noa setglobal foldcolumn=8 " Reset global and local value (without triggering autocmd) noa setglobal foldcolumn=8 " Reset global and local value (without triggering autocmd)
noa setlocal foldcolumn=1 noa setlocal foldcolumn=1
let g:options=[['foldcolumn', '8', '', '8', '2', 'global', 'setglobal']] let g:options = [['foldcolumn', '8', '', '8', '2', 'global', 'setglobal']]
setglobal foldcolumn=2 setglobal foldcolumn=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -964,7 +987,7 @@ func Test_OptionSet()
" 27b: Setting local number local (to window) option" " 27b: Setting local number local (to window) option"
noa setglobal foldcolumn=8 " Reset global and local value (without triggering autocmd) noa setglobal foldcolumn=8 " Reset global and local value (without triggering autocmd)
noa setlocal foldcolumn=1 noa setlocal foldcolumn=1
let g:options=[['foldcolumn', '1', '1', '', '2', 'local', 'setlocal']] let g:options = [['foldcolumn', '1', '1', '', '2', 'local', 'setlocal']]
setlocal foldcolumn=2 setlocal foldcolumn=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -972,14 +995,14 @@ func Test_OptionSet()
" 27c: Setting again number local (to window) option" " 27c: Setting again number local (to window) option"
noa setglobal foldcolumn=8 " Reset global and local value (without triggering autocmd) noa setglobal foldcolumn=8 " Reset global and local value (without triggering autocmd)
noa setlocal foldcolumn=1 noa setlocal foldcolumn=1
let g:options=[['foldcolumn', '1', '1', '8', '2', 'global', 'set']] let g:options = [['foldcolumn', '1', '1', '8', '2', 'global', 'set']]
set foldcolumn=2 set foldcolumn=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 27d: Ssettin again global number local (to window) option" " 27d: Ssettin again global number local (to window) option"
noa set foldcolumn=8 " Reset global and local value (without triggering autocmd) noa set foldcolumn=8 " Reset global and local value (without triggering autocmd)
let g:options=[['foldcolumn', '8', '8', '8', '2', 'global', 'set']] let g:options = [['foldcolumn', '8', '8', '8', '2', 'global', 'set']]
set foldcolumn=2 set foldcolumn=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -988,7 +1011,7 @@ func Test_OptionSet()
" 28a: Setting global boolean global option" " 28a: Setting global boolean global option"
noa setglobal nowrapscan " Reset global and local value (without triggering autocmd) noa setglobal nowrapscan " Reset global and local value (without triggering autocmd)
noa setlocal wrapscan " Sets the global(!) value! noa setlocal wrapscan " Sets the global(!) value!
let g:options=[['wrapscan', '1', '', '1', '0', 'global', 'setglobal']] let g:options = [['wrapscan', '1', '', '1', '0', 'global', 'setglobal']]
setglobal nowrapscan setglobal nowrapscan
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -996,7 +1019,7 @@ func Test_OptionSet()
" 28b: Setting local boolean global option" " 28b: Setting local boolean global option"
noa setglobal nowrapscan " Reset global and local value (without triggering autocmd) noa setglobal nowrapscan " Reset global and local value (without triggering autocmd)
noa setlocal wrapscan " Sets the global(!) value! noa setlocal wrapscan " Sets the global(!) value!
let g:options=[['wrapscan', '1', '1', '', '0', 'local', 'setlocal']] let g:options = [['wrapscan', '1', '1', '', '0', 'local', 'setlocal']]
setlocal nowrapscan setlocal nowrapscan
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1004,14 +1027,14 @@ func Test_OptionSet()
" 28c: Setting again boolean global option" " 28c: Setting again boolean global option"
noa setglobal nowrapscan " Reset global and local value (without triggering autocmd) noa setglobal nowrapscan " Reset global and local value (without triggering autocmd)
noa setlocal wrapscan " Sets the global(!) value! noa setlocal wrapscan " Sets the global(!) value!
let g:options=[['wrapscan', '1', '1', '1', '0', 'global', 'set']] let g:options = [['wrapscan', '1', '1', '1', '0', 'global', 'set']]
set nowrapscan set nowrapscan
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 28d: Setting again global boolean global option" " 28d: Setting again global boolean global option"
noa set nowrapscan " Reset global and local value (without triggering autocmd) noa set nowrapscan " Reset global and local value (without triggering autocmd)
let g:options=[['wrapscan', '0', '0', '0', '1', 'global', 'set']] let g:options = [['wrapscan', '0', '0', '0', '1', 'global', 'set']]
set wrapscan set wrapscan
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1020,7 +1043,7 @@ func Test_OptionSet()
" 29a: Setting global boolean global-local (to buffer) option" " 29a: Setting global boolean global-local (to buffer) option"
noa setglobal noautoread " Reset global and local value (without triggering autocmd) noa setglobal noautoread " Reset global and local value (without triggering autocmd)
noa setlocal autoread noa setlocal autoread
let g:options=[['autoread', '0', '', '0', '1', 'global', 'setglobal']] let g:options = [['autoread', '0', '', '0', '1', 'global', 'setglobal']]
setglobal autoread setglobal autoread
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1028,7 +1051,7 @@ func Test_OptionSet()
" 29b: Setting local boolean global-local (to buffer) option" " 29b: Setting local boolean global-local (to buffer) option"
noa setglobal noautoread " Reset global and local value (without triggering autocmd) noa setglobal noautoread " Reset global and local value (without triggering autocmd)
noa setlocal autoread noa setlocal autoread
let g:options=[['autoread', '1', '1', '', '0', 'local', 'setlocal']] let g:options = [['autoread', '1', '1', '', '0', 'local', 'setlocal']]
setlocal noautoread setlocal noautoread
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1036,14 +1059,14 @@ func Test_OptionSet()
" 29c: Setting again boolean global-local (to buffer) option" " 29c: Setting again boolean global-local (to buffer) option"
noa setglobal noautoread " Reset global and local value (without triggering autocmd) noa setglobal noautoread " Reset global and local value (without triggering autocmd)
noa setlocal autoread noa setlocal autoread
let g:options=[['autoread', '1', '1', '0', '1', 'global', 'set']] let g:options = [['autoread', '1', '1', '0', '1', 'global', 'set']]
set autoread set autoread
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 29d: Setting again global boolean global-local (to buffer) option" " 29d: Setting again global boolean global-local (to buffer) option"
noa set noautoread " Reset global and local value (without triggering autocmd) noa set noautoread " Reset global and local value (without triggering autocmd)
let g:options=[['autoread', '0', '0', '0', '1', 'global', 'set']] let g:options = [['autoread', '0', '0', '0', '1', 'global', 'set']]
set autoread set autoread
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1052,7 +1075,7 @@ func Test_OptionSet()
" 30a: Setting global boolean local (to buffer) option" " 30a: Setting global boolean local (to buffer) option"
noa setglobal nocindent " Reset global and local value (without triggering autocmd) noa setglobal nocindent " Reset global and local value (without triggering autocmd)
noa setlocal cindent noa setlocal cindent
let g:options=[['cindent', '0', '', '0', '1', 'global', 'setglobal']] let g:options = [['cindent', '0', '', '0', '1', 'global', 'setglobal']]
setglobal cindent setglobal cindent
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1060,7 +1083,7 @@ func Test_OptionSet()
" 30b: Setting local boolean local (to buffer) option" " 30b: Setting local boolean local (to buffer) option"
noa setglobal nocindent " Reset global and local value (without triggering autocmd) noa setglobal nocindent " Reset global and local value (without triggering autocmd)
noa setlocal cindent noa setlocal cindent
let g:options=[['cindent', '1', '1', '', '0', 'local', 'setlocal']] let g:options = [['cindent', '1', '1', '', '0', 'local', 'setlocal']]
setlocal nocindent setlocal nocindent
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1068,14 +1091,14 @@ func Test_OptionSet()
" 30c: Setting again boolean local (to buffer) option" " 30c: Setting again boolean local (to buffer) option"
noa setglobal nocindent " Reset global and local value (without triggering autocmd) noa setglobal nocindent " Reset global and local value (without triggering autocmd)
noa setlocal cindent noa setlocal cindent
let g:options=[['cindent', '1', '1', '0', '1', 'global', 'set']] let g:options = [['cindent', '1', '1', '0', '1', 'global', 'set']]
set cindent set cindent
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 30d: Setting again global boolean local (to buffer) option" " 30d: Setting again global boolean local (to buffer) option"
noa set nocindent " Reset global and local value (without triggering autocmd) noa set nocindent " Reset global and local value (without triggering autocmd)
let g:options=[['cindent', '0', '0', '0', '1', 'global', 'set']] let g:options = [['cindent', '0', '0', '0', '1', 'global', 'set']]
set cindent set cindent
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1088,7 +1111,7 @@ func Test_OptionSet()
" 32a: Setting global boolean local (to window) option" " 32a: Setting global boolean local (to window) option"
noa setglobal nocursorcolumn " Reset global and local value (without triggering autocmd) noa setglobal nocursorcolumn " Reset global and local value (without triggering autocmd)
noa setlocal cursorcolumn noa setlocal cursorcolumn
let g:options=[['cursorcolumn', '0', '', '0', '1', 'global', 'setglobal']] let g:options = [['cursorcolumn', '0', '', '0', '1', 'global', 'setglobal']]
setglobal cursorcolumn setglobal cursorcolumn
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1096,7 +1119,7 @@ func Test_OptionSet()
" 32b: Setting local boolean local (to window) option" " 32b: Setting local boolean local (to window) option"
noa setglobal nocursorcolumn " Reset global and local value (without triggering autocmd) noa setglobal nocursorcolumn " Reset global and local value (without triggering autocmd)
noa setlocal cursorcolumn noa setlocal cursorcolumn
let g:options=[['cursorcolumn', '1', '1', '', '0', 'local', 'setlocal']] let g:options = [['cursorcolumn', '1', '1', '', '0', 'local', 'setlocal']]
setlocal nocursorcolumn setlocal nocursorcolumn
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1104,14 +1127,14 @@ func Test_OptionSet()
" 32c: Setting again boolean local (to window) option" " 32c: Setting again boolean local (to window) option"
noa setglobal nocursorcolumn " Reset global and local value (without triggering autocmd) noa setglobal nocursorcolumn " Reset global and local value (without triggering autocmd)
noa setlocal cursorcolumn noa setlocal cursorcolumn
let g:options=[['cursorcolumn', '1', '1', '0', '1', 'global', 'set']] let g:options = [['cursorcolumn', '1', '1', '0', '1', 'global', 'set']]
set cursorcolumn set cursorcolumn
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
" 32d: Setting again global boolean local (to window) option" " 32d: Setting again global boolean local (to window) option"
noa set nocursorcolumn " Reset global and local value (without triggering autocmd) noa set nocursorcolumn " Reset global and local value (without triggering autocmd)
let g:options=[['cursorcolumn', '0', '0', '0', '1', 'global', 'set']] let g:options = [['cursorcolumn', '0', '0', '0', '1', 'global', 'set']]
set cursorcolumn set cursorcolumn
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1119,7 +1142,7 @@ func Test_OptionSet()
" 33: Test autocommands when an option value is converted internally. " 33: Test autocommands when an option value is converted internally.
noa set backspace=1 " Reset global and local value (without triggering autocmd) noa set backspace=1 " Reset global and local value (without triggering autocmd)
let g:options=[['backspace', 'indent,eol', 'indent,eol', 'indent,eol', '2', 'global', 'set']] let g:options = [['backspace', 'indent,eol', 'indent,eol', 'indent,eol', '2', 'global', 'set']]
set backspace=2 set backspace=2
call assert_equal([], g:options) call assert_equal([], g:options)
call assert_equal(g:opt[0], g:opt[1]) call assert_equal(g:opt[0], g:opt[1])
@@ -1139,7 +1162,7 @@ func Test_OptionSet_diffmode()
call test_override('starting', 1) call test_override('starting', 1)
" 18: Changing an option when entering diff mode " 18: Changing an option when entering diff mode
new new
au OptionSet diff :let &l:cul=v:option_new au OptionSet diff :let &l:cul = v:option_new
call setline(1, ['buffer 1', 'line2', 'line3', 'line4']) call setline(1, ['buffer 1', 'line2', 'line3', 'line4'])
call assert_equal(0, &l:cul) call assert_equal(0, &l:cul)
@@ -2355,7 +2378,7 @@ func Test_autocmd_CmdWinEnter()
autocmd CmdWinEnter * quit autocmd CmdWinEnter * quit
let winnr = winnr('$') let winnr = winnr('$')
END END
let filename='XCmdWinEnter' let filename = 'XCmdWinEnter'
call writefile(lines, filename) call writefile(lines, filename)
let buf = RunVimInTerminal('-S '.filename, #{rows: 6}) let buf = RunVimInTerminal('-S '.filename, #{rows: 6})