From f8165cd9dc22bb66213e749ff3362ba475bd7a24 Mon Sep 17 00:00:00 2001 From: Wang Shidong Date: Sat, 2 Jan 2021 20:40:32 +0800 Subject: [PATCH] Add warning message (#4040) when failed to run xclip-copyfile, no warning message is shown. --- config/plugins/defx.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/plugins/defx.vim b/config/plugins/defx.vim index 411d752b5..fe7a52271 100644 --- a/config/plugins/defx.vim +++ b/config/plugins/defx.vim @@ -246,10 +246,17 @@ function! s:DefxCopyFile(_) abort if executable('xclip-copyfile') call s:VCOP.systemlist(['xclip-copyfile', filename]) + if v:shell_error + echohl WarningMsg + echo 'failed to copy file!' + echohl NONE + else + echo 'Yanked:' . filename + endif elseif s:SYS.isWindows let s:copyed_file_path = filename + echo 'Yanked:' . filename endif - echo 'Yanked:' . filename endfunction function! s:DefxPasteFile(_) abort