- Improved neosnippet#util#expand().
This commit is contained in:
parent
f79f3df531
commit
f87a6b324a
@ -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: 30 Sep 2012.
|
" Last Modified: 23 Oct 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,11 +55,12 @@ function! neosnippet#util#iconv(...)"{{{
|
|||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
function! neosnippet#util#expand(path)"{{{
|
function! neosnippet#util#expand(path)"{{{
|
||||||
return s:V.substitute_path_separator(
|
let path = (a:path =~ '^\~') ?
|
||||||
\ (a:path =~ '^\~') ? substitute(a:path, '^\~', expand('~'), '') :
|
\ substitute(a:path, '^\~', expand('~'), '') :
|
||||||
\ (a:path =~ '^\$\h\w*') ? substitute(a:path,
|
\ (a:path =~ '^\$\h\w*') ? substitute(a:path,
|
||||||
\ '^\$\h\w*', '\=eval(submatch(0))', '') :
|
\ '^\$\h\w*', '\=eval(submatch(0))', '') :
|
||||||
\ a:path)
|
\ 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)
|
||||||
|
@ -454,6 +454,9 @@ snippet *neosnippet-unite-action-snippet*
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
CHANGELOG *neosnippet-changelog*
|
CHANGELOG *neosnippet-changelog*
|
||||||
|
|
||||||
|
2012-10-23
|
||||||
|
- Improved neosnippet#util#expand().
|
||||||
|
|
||||||
2012-10-21
|
2012-10-21
|
||||||
- Added options head.
|
- Added options head.
|
||||||
- Added options word.
|
- Added options word.
|
||||||
|
Loading…
Reference in New Issue
Block a user