From 7849901474c6ab3d8ec3472464bf9dd7ca2dec7a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 6 Oct 2020 11:44:00 +1300 Subject: Rewrite comments in patch#() --- vim/autoload/patch.vim | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/vim/autoload/patch.vim b/vim/autoload/patch.vim index 614be462..3a17ccda 100644 --- a/vim/autoload/patch.vim +++ b/vim/autoload/patch.vim @@ -6,19 +6,27 @@ " function! patch#(version) abort - " If we're new enough, we can just use the native has() + " If the Vim running is new enough for its has() function to support + " checking patch levels with version prefixes, we can just add a "patch-" + " prefix to the query, and pass it on to has(). + " if has('patch-7.4.237') return has('patch-'.a:version) endif - " Otherwise, we need to start splitting and comparing numbers + " Failing that, we need to do our own version number and patch number + " comparisons; split the queried version on dots. + " let [major, minor, patch] = split(a:version, '\.') - " The v:version variable looks like e.g. 801 for v8.1 + " The internal variable v:version describing the running Vim looks like + " e.g. 801 for v8.1; reproduce that logic for the queried version. + " let l:version = major * 100 + minor - " If the version numbers are the same, return whether we have the patch; - " otherwise, return whether the version + " If the running version number is the same as the required one, return + " whether we have the specific patch requested; otherwise, return whether + " the running version number is greater than the required one. " return v:version == l:version \ ? has('patch-'.patch) -- cgit v1.2.3 From 5116c5415cab2839450f11914f288d322d536a29 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 6 Oct 2020 15:23:14 +1300 Subject: Inline environment retrieval to save a file load --- vim/autoload/getenv.vim | 17 ----------------- vim/autoload/xdg.vim | 9 +++++---- 2 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 vim/autoload/getenv.vim diff --git a/vim/autoload/getenv.vim b/vim/autoload/getenv.vim deleted file mode 100644 index 3b5f4c1b..00000000 --- a/vim/autoload/getenv.vim +++ /dev/null @@ -1,17 +0,0 @@ -" Backport getenv() from v8.1.1305, except return an empty string rather than -" v:null -" -" -" -function! getenv#(name) abort - - if a:name !~# '^[A-Z][A-Z0-9_]*$' - throw 'Illegal env var name' - endif - let value = '' - if exists('$'.a:name) - execute 'let value = $'.a:name - endif - return value - -endfunction diff --git a/vim/autoload/xdg.vim b/vim/autoload/xdg.vim index c5737506..67a9c5b2 100644 --- a/vim/autoload/xdg.vim +++ b/vim/autoload/xdg.vim @@ -12,10 +12,11 @@ function! s:Get(name) abort if !has_key(s:defaults, name) throw 'Illegal XDG basedirs env var name' endif - let value = getenv#(name) - return value !=# '' - \ ? value - \ : s:defaults[name] + let value = s:defaults[name] + if exists('$'.a:name) + execute 'let value = $'.a:name + endif + return value endfunction function! s:Absolute(path) abort -- cgit v1.2.3 From 0567b56dcbb43f6b05cb074837cde397317be576 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 9 Oct 2020 21:52:16 +1300 Subject: Break some lines to line things up --- vim/vimrc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 2c663550..26407eea 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -2,7 +2,7 @@ " Tom Ryder (tejr)’s Literate Vimrc " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ " -" Last updated: Sun, 04 Oct 2020 04:15:27 UTC +" Last updated: Fri, 09 Oct 2020 08:52:09 UTC " " │ And I was lifted up in heart, and thought " │ Of all my late-shown prowess in the lists, @@ -137,11 +137,16 @@ let $MYVIM = option#Split(&runtimepath)[0] " both the XDG_CONFIG_HOME and XDG_CONFIG_DIRS variables, or from their " defaults, using autoloaded xdg# functions. " -let s:xdgcachehome = xdg#CacheHome() -let s:xdgconfigdirs = xdg#ConfigDirs() -let s:xdgconfighome = xdg#ConfigHome() -let s:xdgdatadirs = xdg#DataDirs() -let s:xdgdatahome = xdg#DataHome() +let s:xdgcachehome + \ = xdg#CacheHome() +let s:xdgconfigdirs + \ = xdg#ConfigDirs() +let s:xdgconfighome + \ = xdg#ConfigHome() +let s:xdgdatadirs + \ = xdg#DataDirs() +let s:xdgdatahome + \ = xdg#DataHome() " We put XDG_CONFIG_HOME at the front of the 'runtimepath' list with insert(), " provided it isn't empty, which is what the function returns when the -- cgit v1.2.3 From 68a19a9fff573f7711ccab8cf25c887afef461f3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 11 Oct 2020 13:22:33 +1300 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 296736b7..3b1f85f7 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v10.12.0 -Mon, 05 Oct 2020 22:20:45 +0000 +tejr dotfiles v10.13.0 +Sun, 11 Oct 2020 00:22:33 +0000 -- cgit v1.2.3