From 10f7e2258ea0d4fa3b4c3b169259da26e0ad2492 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 13 Jun 2019 09:35:51 +1200 Subject: Change 'backupskip' reset to reflect Vim patch --- vim/vimrc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'vim') 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. +" +" +" +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 -- cgit v1.2.3