aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-13 09:35:51 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-13 09:37:09 +1200
commit10f7e2258ea0d4fa3b4c3b169259da26e0ad2492 (patch)
tree7b347ef99dc907291550169c041a2e7bfdfec7c3
parentAdd a missing quote in a comment (diff)
downloaddotfiles-10f7e2258ea0d4fa3b4c3b169259da26e0ad2492.tar.gz
dotfiles-10f7e2258ea0d4fa3b4c3b169259da26e0ad2492.zip
Change 'backupskip' reset to reflect Vim patch
<https://github.com/vim/vim/releases/tag/v8.1.1519>
-rw-r--r--vim/vimrc21
1 files changed, 13 insertions, 8 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 501b32d6..18e9167c 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -324,14 +324,19 @@ else
set backupdir^=$MYVIM/cache/backup
endif
-" Vim doesn't seem to check patterns added to 'backupskip' for uniqueness, so
-" adding them repeatedly if this file is reloaded results in duplicate strings
-" in the value, due to the absence of the P_NODUP flag for the option's
-" definition in src/option.c in the Vim source code. This is likely a bug in
-" Vim. For the moment, to work around the problem, we reset the path back to
-" its default first.
-"
-set backupskip&
+" Prior to v8.1.1519, Vim didn't check patterns added to 'backupskip' for
+" uniqueness, so adding the same path repeatedly resulted in duplicate strings
+" in the value. This was due to the absence of the P_NODUP flag for the
+" option's definition in src/option.c in the Vim source code. If we're using
+" a version older than v8.1.1519, we'll need to explicitly reset 'backupskip'
+" to its default value, so that reloading this file doesn't stack up multiple
+" copies of any added paths.
+"
+" <https://github.com/vim/vim/releases/tag/v8.1.1519>
+"
+if !has('patch-8.1.1519')
+ set backupskip&
+endif
" Files in certain directories on Unix-compatible filesystems should not be
" backed up, for security reasons. This is particularly important if editing