aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-07-07 15:53:33 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-07-07 15:53:33 +1200
commit248e39e39bc913d9169c0a0d3bf2a2659d655866 (patch)
tree87cae663f166ca7033a37596fb62003e1e6dfdaf
parentMerge branch 'release/v6.51.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-248e39e39bc913d9169c0a0d3bf2a2659d655866.tar.gz
dotfiles-248e39e39bc913d9169c0a0d3bf2a2659d655866.zip
Merge branch 'release/v6.52.0'v6.52.0
* release/v6.52.0: Correct typo Backport convenient patch-* test to old Vim
-rw-r--r--VERSION4
-rw-r--r--vim/autoload/has.vim16
-rw-r--r--vim/vimrc26
3 files changed, 31 insertions, 15 deletions
diff --git a/VERSION b/VERSION
index 5a80561a..dd18bfcc 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v6.51.0
-Sat, 06 Jul 2019 12:30:25 +0000
+tejr dotfiles v6.52.0
+Sun, 07 Jul 2019 03:53:31 +0000
diff --git a/vim/autoload/has.vim b/vim/autoload/has.vim
new file mode 100644
index 00000000..0100e913
--- /dev/null
+++ b/vim/autoload/has.vim
@@ -0,0 +1,16 @@
+function! has#(feature) abort
+ if has('patch-7.4.237')
+ return has(a:feature)
+ endif
+ let feature = a:feature
+ let pattern = 'patch-\(\d\+\)\.\(\d\+\)\.\(\d\+\)'
+ let matchlist = matchlist(feature, pattern)
+ if empty(matchlist)
+ return has(a:feature)
+ endif
+ let [major, minor, patch] = matchlist[1:3]
+ let l:version = major * 100 + minor
+ return v:version != l:version
+ \ ? v:version > l:version
+ \ : has('patch-'.patch)
+endfunction
diff --git a/vim/vimrc b/vim/vimrc
index cf0c4675..50e871c2 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -105,7 +105,7 @@ elseif &runtimepath !=# ''
endif
" We need a command to reliably establish a full path, whether or not the
-" directories already exist. We create a wrapper for the autolated function
+" directories already exist. We create a wrapper for the autoloaded function
" path#Create() with similar calling conventions to mkdir(), but with the ‘p’
" value for the second parameter {prot} forced on.
"
@@ -179,7 +179,7 @@ set history=10000
"
set backup
execute 'set backupdir^='.escape#Arg(escape#Item(
- \ $MYVIM.'/backup'.(has('patch-8.1.251') ? '//' : ''),
+ \ $MYVIM.'/backup'.(has#('patch-8.1.251') ? '//' : ''),
\))
CreatePath! $MYVIM/backup
@@ -203,8 +203,8 @@ CreatePath! $MYVIM/backup
"
" <https://github.com/vim/vim/releases/tag/v8.1.1519>
"
-if has('unix')
- if !has('patch-8.1.1519')
+if has#('unix')
+ if !has#('patch-8.1.1519')
set backupskip&
endif
set backupskip^=/dev/shm/*,/usr/tmp/*,/var/tmp/*
@@ -233,7 +233,7 @@ CreatePath! $MYVIM/swap
" Support for these persistent undo file caches was not released until v7.3.0,
" so we need to check for the feature’s presence before we enable it.
"
-if has('persistent_undo')
+if has#('persistent_undo')
set undofile
execute 'set undodir^='.escape#Arg(escape#Item($MYVIM.'/undo//'))
CreatePath! $MYVIM/undo
@@ -315,7 +315,7 @@ let s:spelllang = split#Option(&spelllang)
let s:spellfile = $MYVIM.'/spell/'.join([
\ split(s:spelllang[0], '_')[0], &encoding, 'add',
\], '.')
-if has('unix')
+if has#('unix')
let s:isfname = &isfname
set isfname=1-255
endif
@@ -438,7 +438,7 @@ set smarttab
"
" <https://github.com/vim/vim/releases/tag/v7.3.693>
"
-if v:version > 703 || v:version == 703 && has('patch693')
+if has#('patch-7.3.693')
set softtabstop=-1
else
let &softtabstop = &shiftwidth
@@ -471,7 +471,7 @@ set linebreak
" Checking that ‘&encoding ==# 'utf-8'’ is not quite the same thing, though
" it’s unlikely I’ll ever use a different Unicode encoding by choice.
"
-if has('multi_byte_encoding')
+if has#('multi_byte_encoding')
set showbreak=…
else
set showbreak=...
@@ -550,7 +550,7 @@ set formatoptions+=1
"
" <https://github.com/vim/vim/releases/tag/v7.3.541>
"
-if v:version > 703 || v:version == 703 && has('patch541')
+if has#('patch-7.3.541')
set formatoptions+=j
endif
@@ -590,7 +590,7 @@ set cpoptions+=J
"
" <https://github.com/vim/vim/releases/tag/v8.1.1523>
"
-if has('patch-8.1.728')
+if has#('patch-8.1.728')
set formatoptions+=p
endif
@@ -602,7 +602,7 @@ endif
" flag should be set here, rather that in the GUI-specific gvimrc file, as one
" might otherwise think.
"
-if has('gui_running')
+if has#('gui_running')
set guioptions+=M
endif
@@ -673,7 +673,7 @@ set listchars+=nbsp:+ " Non-breaking spaces
"
" Failing that, ‘<’ and ‘>’ will do the trick.
"
-if has('multi_byte_encoding')
+if has#('multi_byte_encoding')
set listchars+=extends:»,precedes:«
else
set listchars+=extends:>,precedes:<
@@ -930,7 +930,7 @@ endif
" it.
"
if &background ==# 'dark'
- \ && (has('gui_running') || &t_Co >= 256)
+ \ && (has#('gui_running') || &t_Co >= 256)
\ && globpath(&runtimepath, 'colors/sahara.vim') !=# ''
colorscheme sahara
endif