Skip to content

Commit 2ed74f0

Browse files
Richard Batemanspf13
Richard Bateman
authored andcommitted
Fixed autodirs on windows -- for real this time, I hope
1 parent 80f395d commit 2ed74f0

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

.vimrc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -404,16 +404,8 @@ function! InitializeDirectories()
404404
echo "Warning: Unable to create backup directory: " . directory
405405
echo "Try: mkdir -p " . directory
406406
else
407-
if has('win32') || has('win64')
408-
" Adding an extra trailing slash so it stores the path and not just the
409-
" filename so there aren't collisions for backups
410-
" Windows Vista / 7 has UAC issues, so setting $temp as fallback
411-
exec "set " . settingname . "=\"" . directory . "\""
412-
print "Setting " . settingname . " = " . directory
413-
else
414-
" For Linux/Mac OS (others?) these directives must not be quoted
415-
exec "set " . settingname . "=" . directory
416-
endif
407+
let directory = substitute(directory, " ", "\\\\ ", "")
408+
exec "set " . settingname . "=" . directory
417409
endif
418410
endfor
419411
endfunction

0 commit comments

Comments
 (0)