aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-04-26 17:23:23 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-04-26 17:23:23 +1200
commit130ebe3e32b5fcc5f83611d5c1403688d1a38b3c (patch)
tree5bb696b9b13dea387f7da99c8b2d0f48a4690473
parentMerge branch 'hotfix/v8.20.4' (diff)
parentBump VERSION (diff)
downloaddotfiles-130ebe3e32b5fcc5f83611d5c1403688d1a38b3c.tar.gz
dotfiles-130ebe3e32b5fcc5f83611d5c1403688d1a38b3c.zip
Merge branch 'hotfix/v8.20.5'v8.20.5
* hotfix/v8.20.5: Improve robustness of option directory creation
-rw-r--r--VERSION4
-rw-r--r--vim/vimrc45
2 files changed, 31 insertions, 18 deletions
diff --git a/VERSION b/VERSION
index e8969b76..8b8daf23 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v8.20.4
-Sat, 25 Apr 2020 16:27:41 +0000
+tejr dotfiles v8.20.5
+Sun, 26 Apr 2020 05:23:07 +0000
diff --git a/vim/vimrc b/vim/vimrc
index 59f66360..b62e9764 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -149,9 +149,10 @@ command! -bang -bar -complete=dir -nargs=1 CreatePath
"
" <https://github.com/vim/vim/releases/tag/v8.1.0716>
"
-if xdg#['cache']['home'] !=# ''
- execute 'set viminfo+='.option#Escape('n'.xdg#['cache']['home'].'/viminfo')
- call path#Create(xdg#['cache']['home'])
+if xdg#['cache']['home'] !=# '' && path#Create(xdg#['cache']['home'])
+ execute 'set viminfo+='.option#Escape(
+ \ 'n'.xdg#['cache']['home'].'/viminfo'
+ \)
endif
" Speaking of recorded data in viminfo files, the default Vim limit of a mere
@@ -198,10 +199,13 @@ set history=10000
"
set backup
if xdg#['cache']['home'] !=# ''
- execute 'set backupdir^='.option#Escape(option#item#Escape(
- \ xdg#['cache']['home'].'/backup'.(has#('patch-8.1.251') ? '//' : ''),
- \))
- call path#Create(xdg#['cache']['home'].'/backup')
+ let s:backupdir = xdg#['cache']['home'].'/backup'
+ if path#Create(s:backupdir)
+ execute 'set backupdir^='.option#Escape(option#item#Escape(
+ \ s:backupdir.(has#('patch-8.1.251') ? '//' : ''),
+ \))
+ endif
+ unlet s:backupdir
endif
" Files in certain directories on Unix-compatible filesystems should not be
@@ -240,9 +244,12 @@ endif
"
if xdg#['cache']['home'] !=# ''
let s:directory = xdg#['cache']['home'].'/swap'
- execute 'set directory^='
- \.option#Escape(option#item#Escape(s:directory.'//'))
- call path#Create(s:directory)
+ if path#Create(s:directory)
+ execute 'set directory^='.option#Escape(option#item#Escape(
+ \ s:directory.'//'
+ \))
+ endif
+ unlet s:directory
endif
" Keep tracked undo history for files permanently, in a dedicated cache
@@ -262,9 +269,12 @@ if has#('persistent_undo')
set undofile
if xdg#['cache']['home'] !=# ''
let s:undodir = xdg#['cache']['home'].'/undo'
- execute 'set undodir^='
- \.option#Escape(option#item#Escape(s:undodir.'//'))
- call path#Create(s:undodir)
+ if path#Create(s:undodir)
+ execute 'set undodir^='.option#Escape(option#item#Escape(
+ \ s:undodir.'//'
+ \))
+ endif
+ unlet s:undodir
endif
endif
@@ -275,9 +285,11 @@ endif
"
if has#('mksession') && xdg#['cache']['home']
let s:viewdir = xdg#['cache']['home'].'/view'
- execute 'set viewdir='
- \.option#Escape(option#item#Escape(s:viewdir))
- call path#Create(s:viewdir)
+ if path#Create(s:viewdir)
+ execute 'set viewdir='
+ \.option#Escape(option#item#Escape(s:viewdir))
+ endif
+ unlet s:viewdir
endif
" Now that we have a bit more confidence in our runtime environment, set up
@@ -403,6 +415,7 @@ try
execute 'set thesaurus^='
\.option#Escape(option#item#Escape(s:refdir.'/thesaurus.txt'))
endfor
+ unlet s:refdirs s:refdir
catch /^Vim\%((\a\+)\)\=:E474:/
endtry