diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-04-26 17:23:23 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-04-26 17:23:23 +1200 |
commit | 130ebe3e32b5fcc5f83611d5c1403688d1a38b3c (patch) | |
tree | 5bb696b9b13dea387f7da99c8b2d0f48a4690473 | |
parent | Merge branch 'hotfix/v8.20.4' (diff) | |
parent | Bump VERSION (diff) | |
download | dotfiles-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-- | VERSION | 4 | ||||
-rw-r--r-- | vim/vimrc | 45 |
2 files changed, 31 insertions, 18 deletions
@@ -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 @@ -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 |