From 705d61471c8e5ead4767371ecf7c563c69e77d9d Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 17 Nov 2012 08:49:18 +0900 Subject: [PATCH] - Improved for expand(). --- autoload/neosnippet/util.vim | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/autoload/neosnippet/util.vim b/autoload/neosnippet/util.vim index b494ec0..c4f92a3 100644 --- a/autoload/neosnippet/util.vim +++ b/autoload/neosnippet/util.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: util.vim " AUTHOR: Shougo Matsushita -" 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)