diff options
author | ckelsel <ckelsel@hotmail.com> | 2017-07-16 08:22:49 +0800 |
---|---|---|
committer | ckelsel <ckelsel@hotmail.com> | 2017-07-16 08:22:49 +0800 |
commit | cb95f71f71f665b21848cf25780d83278cd1dcf0 (patch) | |
tree | 4ebdf96b731ae839f8beb326e36dcb0b429bc453 /runtime/autoload | |
parent | 8cc49f9f1ad4edface62284c32f05ef1140d8220 (diff) | |
parent | 4dee942e732d41ad62b732c0a39719d9405bc928 (diff) | |
download | rneovim-cb95f71f71f665b21848cf25780d83278cd1dcf0.tar.gz rneovim-cb95f71f71f665b21848cf25780d83278cd1dcf0.tar.bz2 rneovim-cb95f71f71f665b21848cf25780d83278cd1dcf0.zip |
merge upstream/master
Diffstat (limited to 'runtime/autoload')
-rw-r--r-- | runtime/autoload/health.vim | 3 | ||||
-rw-r--r-- | runtime/autoload/health/provider.vim | 4 | ||||
-rw-r--r-- | runtime/autoload/provider/clipboard.vim | 20 |
3 files changed, 20 insertions, 7 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index 1d8cae7d19..f875c8b797 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -33,7 +33,8 @@ function! health#check(plugin_names) abort setlocal wrap breakindent setlocal filetype=markdown setlocal conceallevel=2 concealcursor=nc - setlocal keywordprg=:help iskeyword=@,48-57,_,192-255,-,# + setlocal keywordprg=:help + let &l:iskeyword='!-~,^*,^|,^",192-255' call s:enhance_syntax() if empty(healthchecks) diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 31a235a397..ec20615f69 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -125,6 +125,10 @@ function! s:check_clipboard() abort call health#report_warn( \ 'No clipboard tool found. Clipboard registers will not work.', \ [':help clipboard']) + elseif exists('g:clipboard') && (type({}) != type(g:clipboard) + \ || !has_key(g:clipboard, 'copy') || !has_key(g:clipboard, 'paste')) + call health#report_error( + \ 'g:clipboard exists but is malformed. It must be a dictionary with the keys documented at :help g:clipboard') else call health#report_ok('Clipboard tool found: '. clipboard_tool) endif diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index a67681d28e..47f4271091 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -137,16 +137,24 @@ function! s:clipboard.set(lines, regtype, reg) abort let argv = split(s:copy[a:reg], " ") let selection.detach = s:cache_enabled let selection.cwd = "/" + call extend(selection, { + \ 'on_stdout': function('s:set_errhandler'), + \ 'on_stderr': function('s:set_errhandler'), + \ }) let jobid = jobstart(argv, selection) - if jobid <= 0 + if jobid > 0 + call jobsend(jobid, a:lines) + call jobclose(jobid, 'stdin') + let selection.owner = jobid + endif +endfunction + +function! s:set_errhandler(job_id, data, event) abort + if a:job_id <= 0 echohl WarningMsg - echo "clipboard: error when invoking provider" + echo 'clipboard: error when invoking provider: ' . join(a:data) echohl None - return 0 endif - call jobsend(jobid, a:lines) - call jobclose(jobid, 'stdin') - let selection.owner = jobid endfunction function! provider#clipboard#Call(method, args) abort |