feat(defaults): switchbuf=uselast #15394

This commit is contained in:
Gregory Anders 2021-08-16 12:20:46 -06:00 committed by GitHub
parent 7215d35694
commit 4ba74953b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 3 deletions

View File

@ -6116,7 +6116,7 @@ A jump table for the options with a short description can be found at |Q_op|.
specify special kinds of buffers. See |special-buffers|. specify special kinds of buffers. See |special-buffers|.
*'switchbuf'* *'swb'* *'switchbuf'* *'swb'*
'switchbuf' 'swb' string (default "") 'switchbuf' 'swb' string (default "uselast")
global global
This option controls the behavior when switching between buffers. This option controls the behavior when switching between buffers.
Possible values (comma separated list): Possible values (comma separated list):

View File

@ -56,6 +56,7 @@ the differences.
- 'sidescroll' defaults to 1 - 'sidescroll' defaults to 1
- 'smarttab' is enabled - 'smarttab' is enabled
- 'startofline' is disabled - 'startofline' is disabled
- 'switchbuf' defaults to "uselast"
- 'tabpagemax' defaults to 50 - 'tabpagemax' defaults to 50
- 'tags' defaults to "./tags;,tags" - 'tags' defaults to "./tags;,tags"
- 'ttimeoutlen' defaults to 50 - 'ttimeoutlen' defaults to 50

View File

@ -2390,7 +2390,7 @@ return {
type='string', list='onecomma', scope={'global'}, type='string', list='onecomma', scope={'global'},
deny_duplicates=true, deny_duplicates=true,
varname='p_swb', varname='p_swb',
defaults={if_true={vi=""}} defaults={if_true={vi="uselast"}}
}, },
{ {
full_name='synmaxcol', abbreviation='smc', full_name='synmaxcol', abbreviation='smc',

View File

@ -21,6 +21,7 @@ set undodir^=.
set wildoptions= set wildoptions=
set startofline set startofline
set sessionoptions+=options set sessionoptions+=options
set switchbuf=
" Unmap Nvim default mappings. " Unmap Nvim default mappings.
unmap Y unmap Y

View File

@ -1911,7 +1911,7 @@ func Test_switchbuf()
enew | only enew | only
set switchbuf=useopen set switchbuf=useopen
cexpr "Xqftestfile1:1:10" cexpr "Xqftestfile1:1:10"
call assert_equal('', &switchbuf) call assert_equal('uselast', &switchbuf)
call delete('Xqftestfile1') call delete('Xqftestfile1')
call delete('Xqftestfile2') call delete('Xqftestfile2')