From d207440f1e739172477083078d4a6fe7858e772b Mon Sep 17 00:00:00 2001 From: "@equalsraf" Date: Tue, 4 Dec 2018 20:38:20 +0000 Subject: 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. --- runtime/autoload/provider/clipboard.vim | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'runtime') 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) -- cgit