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.
This commit is contained in:
@equalsraf 2018-12-04 20:38:20 +00:00 committed by Justin M. Keyes
parent 7e97587dae
commit d207440f1e

View File

@ -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)