diff options
author | @equalsraf <equalsraf@users.noreply.github.com> | 2018-12-04 20:38:20 +0000 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-12-04 21:38:20 +0100 |
commit | d207440f1e739172477083078d4a6fe7858e772b (patch) | |
tree | bf2e9ed0936460a702fa2fa2ee31f5ebc4b70cf5 | |
parent | 7e97587daec2bc9e5989e4c2b15785d84314debc (diff) | |
download | rneovim-d207440f1e739172477083078d4a6fe7858e772b.tar.gz rneovim-d207440f1e739172477083078d4a6fe7858e772b.tar.bz2 rneovim-d207440f1e739172477083078d4a6fe7858e772b.zip |
clipboard: Revert unused check #9309
PR #9304 added support for functions in clipboard providers. As part of
the PR I meant to move two checks in the provider code out of an if
statement into separate statements and adding additional checks for
g:clipboard attributes - as it turns out the code is wrong and it does
not implement additional checks while it adds two conditions that make
very little sense
type(g:clipboard['copy']) #isnot# v:t_func
what would make sense would be something along the lines of
type(g:clipboard['copy']['+']) #isnot# v:t_func
but might not be what we want either, so I'm reverting this.
-rw-r--r-- | runtime/autoload/provider/clipboard.vim | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 8bbb72f933..fd32e03666 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -55,22 +55,12 @@ endfunction function! provider#clipboard#Executable() abort if exists('g:clipboard') if type({}) isnot# type(g:clipboard) + \ || type({}) isnot# type(get(g:clipboard, 'copy', v:null)) + \ || type({}) isnot# type(get(g:clipboard, 'paste', v:null)) let s:err = 'clipboard: invalid g:clipboard' return '' endif - if type(get(g:clipboard, 'copy', v:null)) isnot# v:t_dict - \ && type(get(g:clipboard, 'copy', v:null)) isnot# v:t_func - let s:err = "clipboard: invalid g:clipboard['copy']" - return '' - endif - - if type(get(g:clipboard, 'paste', v:null)) isnot# v:t_dict - \ && type(get(g:clipboard, 'paste', v:null)) isnot# v:t_func - let s:err = "clipboard: invalid g:clipboard['paste']" - return '' - endif - let s:copy = get(g:clipboard, 'copy', { '+': v:null, '*': v:null }) let s:paste = get(g:clipboard, 'paste', { '+': v:null, '*': v:null }) let s:cache_enabled = get(g:clipboard, 'cache_enabled', 0) |