- Improved for expand().
This commit is contained in:
parent
9653ba6c32
commit
705d61471c
@ -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: 23 Oct 2012.
|
" Last Modified: 17 Nov 2012.
|
||||||
" 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
|
||||||
@ -55,12 +55,8 @@ function! neosnippet#util#iconv(...)"{{{
|
|||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
function! neosnippet#util#expand(path)"{{{
|
function! neosnippet#util#expand(path)"{{{
|
||||||
let path = (a:path =~ '^\~') ?
|
return neosnippet#util#substitute_path_separator(
|
||||||
\ substitute(a:path, '^\~', expand('~'), '') :
|
\ expand(escape(a:path, '*?[]"={}'), 1))
|
||||||
\ (a:path =~ '^\$\h\w*') ? substitute(a:path,
|
|
||||||
\ '^\$\h\w*', '\=eval(submatch(0))', '') :
|
|
||||||
\ a:path
|
|
||||||
return s:V.substitute_path_separator(fnamemodify(path, ':p'))
|
|
||||||
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) || type({a:var}) != type(a:val)
|
||||||
|
Loading…
Reference in New Issue
Block a user