aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2020-05-13 14:54:32 +0800
committerGitHub <noreply@github.com>2020-05-13 14:54:32 +0800
commit8f05c163a20874a1513782e21d1e4378e2966c77 (patch)
tree5a3431f7bcceded21f1b9a8681f0c26e1056f48b
parentdd20d92a2fb7158f939a21eadaeef9ae8cd14532 (diff)
do not set clipboard when no provider is found
When there is no clipboard provider but we set the `clipboard` option, using the `:yank` command will produce a warning message. We need to check if a clipboard provider exists before setting up the clipboard option, see also [this issue](https://github.com/neovim/neovim/issues/12305).
-rw-r--r--options.vim4
1 files changed, 3 insertions, 1 deletions
diff --git a/options.vim b/options.vim
index ac12914..fff2496 100644
--- a/options.vim
+++ b/options.vim
@@ -18,7 +18,9 @@ set updatetime=2000
" Clipboard settings, always use clipboard for all delete, yank, change, put
" operation, see https://stackoverflow.com/q/30691466/6064933
-set clipboard+=unnamedplus
+if !empty(provider#clipboard#Executable())
+ set clipboard+=unnamedplus
+endif
" Disable creating swapfiles, see https://stackoverflow.com/q/821902/6064933
set noswapfile