- Fixed neosnippet#util#set_default().
This commit is contained in:
parent
ad8cc61168
commit
b59609c74e
@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: util.vim
|
" FILE: util.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
||||||
" Last Modified: 12 Nov 2013.
|
" Last Modified: 13 Nov 2013.
|
||||||
" License: MIT license {{{
|
" License: MIT license {{{
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
" a copy of this software and associated documentation files (the
|
" a copy of this software and associated documentation files (the
|
||||||
@ -65,11 +65,8 @@ function! neosnippet#util#expand(path) "{{{
|
|||||||
\ expand(escape(a:path, '*?[]"={}'), 1))
|
\ expand(escape(a:path, '*?[]"={}'), 1))
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
function! neosnippet#util#set_default(var, val, ...) "{{{
|
function! neosnippet#util#set_default(var, val, ...) "{{{
|
||||||
if !exists(a:var) || type({a:var}) != type(a:val)
|
if !exists(a:var)
|
||||||
let alternate_var = get(a:000, 0, '')
|
let {a:var} = a:val
|
||||||
|
|
||||||
let {a:var} = exists(alternate_var) ?
|
|
||||||
\ {alternate_var} : a:val
|
|
||||||
endif
|
endif
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
function! neosnippet#util#set_dictionary_helper(...) "{{{
|
function! neosnippet#util#set_dictionary_helper(...) "{{{
|
||||||
|
Loading…
Reference in New Issue
Block a user