From 4620fc91ff048b4bb1b87980faff046ec5da6b38 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 6 Jul 2019 23:55:37 +1200 Subject: Handle path expansion in CreatePath --- vim/autoload/path.vim | 5 +++-- vim/vimrc | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vim/autoload/path.vim b/vim/autoload/path.vim index 2506ad53..410cd294 100644 --- a/vim/autoload/path.vim +++ b/vim/autoload/path.vim @@ -2,9 +2,10 @@ function! path#Create(name, ...) abort if a:0 > 2 echoerr 'Too many arguments' endif - if isdirectory(a:name) + let name = expand(a:name) + if isdirectory(name) return 1 endif let prot = a:0 >= 1 ? a:1 : 0755 - return mkdir(a:name, 'p', prot) + return mkdir(name, 'p', prot) endfunction diff --git a/vim/vimrc b/vim/vimrc index aa08fcfd..ddece845 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -111,7 +111,7 @@ endif " provide alternative permissions in the second argument. " command! -bar -complete=dir -nargs=+ CreatePath - \ call path#Create(expand()) + \ call path#Create() " Now that we have a way to create directories if they don’t already exist, " let’s apply it for the first time to the user runtime directory. Note that -- cgit v1.2.3