diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-09 16:56:09 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-09 16:56:09 +1200 |
commit | a33746005f22b743d2c4a1ec8e2c836405f2436f (patch) | |
tree | c9d8e94d7b89395944f510b1b2bdaf6008242a33 | |
parent | Merge branch 'hotfix/v8.31.1' (diff) | |
download | dotfiles-a33746005f22b743d2c4a1ec8e2c836405f2436f.tar.gz dotfiles-a33746005f22b743d2c4a1ec8e2c836405f2436f.zip |
Make copies for map(), filter(), and reverse()
I really should have remembered this. Caused broken 'thesaurus'
entries, in this case.
-rw-r--r-- | vim/autoload/option.vim | 2 | ||||
-rw-r--r-- | vim/autoload/xdg.vim | 2 | ||||
-rw-r--r-- | vim/vimrc | 14 |
3 files changed, 11 insertions, 7 deletions
diff --git a/vim/autoload/option.vim b/vim/autoload/option.vim index c44cf94b..49fbf1a4 100644 --- a/vim/autoload/option.vim +++ b/vim/autoload/option.vim @@ -7,7 +7,7 @@ function! option#Split(expr, ...) abort endif let keepempty = a:0 ? a:1 : 0 let parts = split(a:expr, '\\\@<!,[, ]*', keepempty) - return map(parts, 'substitute(v:val, ''\\,'', '','', ''g'')') + return map(copy(parts), 'substitute(v:val, ''\\,'', '','', ''g'')') endfunction " Escape the right-hand side of a :set option value diff --git a/vim/autoload/xdg.vim b/vim/autoload/xdg.vim index dd9a129b..5cef0f98 100644 --- a/vim/autoload/xdg.vim +++ b/vim/autoload/xdg.vim @@ -37,7 +37,7 @@ endfunction function! s:Dirs(name) abort let dirs = split(s:Get(a:name), ':') return map( - \ filter(dirs, 's:Absolute(v:val)') + \ filter(copy(dirs), 's:Absolute(v:val)') \,'join([v:val, s:subdir], "/")' \) endfunction @@ -2,7 +2,7 @@ " Tom Ryder (tejr)’s Literate Vimrc " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ " -" Last updated: Mon, 04 May 2020 00:51:58 UTC +" Last updated: Sat, 09 May 2020 04:48:24 UTC " " │ And I was lifted up in heart, and thought " │ Of all my late-shown prowess in the lists, @@ -118,10 +118,12 @@ if xdg#['config']['home'] !=# '' endif if !empty(s:xdgconfigpaths) execute 'set runtimepath^='.option#Escape(join(map( - \ s:xdgconfigpaths, 'option#item#Escape(v:val)' + \ copy(s:xdgconfigpaths), + \ 'option#item#Escape(v:val)' \), ',')) execute 'set runtimepath+='.option#Escape(join(map( - \ reverse(s:xdgconfigpaths), 'option#item#Escape(v:val."/after")' + \ reverse(copy(s:xdgconfigpaths)), + \ 'option#item#Escape(v:val.''/after'')' \), ',')) endif unlet s:xdgconfigpaths @@ -419,10 +421,12 @@ endif if !empty(s:refdirs) try execute 'set dictionary^='.option#Escape(join(map( - \ s:refdirs, 'option#item#Escape(v:val."/dictionary.txt")' + \ copy(s:refdirs), + \ 'option#item#Escape(v:val.''/dictionary.txt'')' \), ',')) execute 'set thesaurus^='.option#Escape(join(map( - \ s:refdirs, 'option#item#Escape(v:val."/thesaurus.txt")' + \ copy(s:refdirs), + \ 'option#item#Escape(v:val.''/thesaurus.txt'')' \), ',')) catch /^Vim\%((\a\+)\)\=:E474:/ endtry |