Avoid extra spaces added to custom quotes (#336)
Without copying the array returned from `s:set_custom_section()`, repeated invocations may lead to accidental mutation of its arguments, such as adding extra spaces to custom header and footer quotes.
This commit is contained in:
parent
187e46aea3
commit
556bf1d507
|
@ -514,7 +514,7 @@ endfunction
|
||||||
" Function: s:set_custom_section {{{1
|
" Function: s:set_custom_section {{{1
|
||||||
function! s:set_custom_section(section) abort
|
function! s:set_custom_section(section) abort
|
||||||
if type(a:section) == type([])
|
if type(a:section) == type([])
|
||||||
return a:section
|
return copy(a:section)
|
||||||
elseif type(a:section) == type('')
|
elseif type(a:section) == type('')
|
||||||
return empty(a:section) ? [] : eval(a:section)
|
return empty(a:section) ? [] : eval(a:section)
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue