- Improved for expand().
This commit is contained in:
parent
9653ba6c32
commit
705d61471c
@ -1,7 +1,7 @@
|
||||
"=============================================================================
|
||||
" FILE: util.vim
|
||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
||||
" Last Modified: 23 Oct 2012.
|
||||
" Last Modified: 17 Nov 2012.
|
||||
" License: MIT license {{{
|
||||
" Permission is hereby granted, free of charge, to any person obtaining
|
||||
" a copy of this software and associated documentation files (the
|
||||
@ -55,12 +55,8 @@ function! neosnippet#util#iconv(...)"{{{
|
||||
endfunction"}}}
|
||||
|
||||
function! neosnippet#util#expand(path)"{{{
|
||||
let path = (a:path =~ '^\~') ?
|
||||
\ substitute(a:path, '^\~', expand('~'), '') :
|
||||
\ (a:path =~ '^\$\h\w*') ? substitute(a:path,
|
||||
\ '^\$\h\w*', '\=eval(submatch(0))', '') :
|
||||
\ a:path
|
||||
return s:V.substitute_path_separator(fnamemodify(path, ':p'))
|
||||
return neosnippet#util#substitute_path_separator(
|
||||
\ expand(escape(a:path, '*?[]"={}'), 1))
|
||||
endfunction"}}}
|
||||
function! neosnippet#util#set_default(var, val, ...) "{{{
|
||||
if !exists(a:var) || type({a:var}) != type(a:val)
|
||||
|
Loading…
Reference in New Issue
Block a user