diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-06 23:55:59 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-06 23:55:59 +1200 |
commit | 45e7fb1d9ada7e8c38bd8efae0a106c7f3afec12 (patch) | |
tree | fcafff19fa90a3758b46e5dcbd9085c731af11ee | |
parent | Create cache directories as needed with function (diff) | |
download | dotfiles-45e7fb1d9ada7e8c38bd8efae0a106c7f3afec12.tar.gz dotfiles-45e7fb1d9ada7e8c38bd8efae0a106c7f3afec12.zip |
Strip trailing-double-slashes for dir creates
-rw-r--r-- | vim/autoload/vimrc.vim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim index 2c9a9cd2..57c2f0f4 100644 --- a/vim/autoload/vimrc.vim +++ b/vim/autoload/vimrc.vim @@ -12,9 +12,10 @@ function! vimrc#EscapeSetPart(string) abort endfunction " Expand the first path in an option string, check if it exists, and attempt -" to create it if it doesn't. +" to create it if it doesn't. Strip double-trailing-slash hints. function! vimrc#Establish(string) abort let part = vimrc#SplitOption(a:string)[0] + let part = substitute(part, '//$', '', '') let dirname = expand(part) return isdirectory(dirname) \ || mkdir(dirname, 'p') |