diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-07-07 00:30:26 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-07-07 00:30:26 +1200 |
commit | 2959ae47f0a95b74c07b92827da6653657785943 (patch) | |
tree | 37e1778f8998a54bf84dec2ada71ed3da567effa /vim/autoload/map.vim | |
parent | Merge branch 'release/v6.50.0' (diff) | |
parent | Bump VERSION (diff) | |
download | dotfiles-2959ae47f0a95b74c07b92827da6653657785943.tar.gz dotfiles-2959ae47f0a95b74c07b92827da6653657785943.zip |
Merge branch 'release/v6.51.0'v6.51.0
* release/v6.51.0:
Set 'spellfile' back to default before prefixing
Remove multibyte character from autoload file
Rearrange command/function call semantics
Handle path expansion in CreatePath
Expand arguments to :CreatePath
Force load of Funcref autoload func on older Vim
Adjust order of directory reference and creation
Remove excessive linebreaks
More vimrc comment refactoring
Revert to simpler spelling approach
Add case sensitivity flag to needed opers
Refine NZ vs US Vim spelling setup
Factor out functions from vimrc
Add an idea
Remove an implemented idea
Add an issue
Diffstat (limited to 'vim/autoload/map.vim')
-rw-r--r-- | vim/autoload/map.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vim/autoload/map.vim b/vim/autoload/map.vim new file mode 100644 index 00000000..d4bd90a2 --- /dev/null +++ b/vim/autoload/map.vim @@ -0,0 +1,12 @@ +" We declare a wrapper around map() to allow us always to call it with +" a Funcref as the second function parameter, which isn't directly supported +" by map() until Vim v7.4.1989. If the running version is older than that, +" apply string() to the Funcref to use the older calling convention. +" +" <https://github.com/vim/vim/releases/tag/v7.4.1989> +" +function! map#(list, Func) abort + return has('patch-7.4.1989') + \ ? map(a:list, a:Func) + \ : map(a:list, string(a:Func).'(0, v:val)') +endfunction |