mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-19 14:59:55 +08:00
Fix #2438 - Print a friendly message when the clipboard is not available
This commit is contained in:
@@ -238,6 +238,12 @@ function! ale#debugging#Info() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#debugging#InfoToClipboard() abort
|
function! ale#debugging#InfoToClipboard() abort
|
||||||
|
if !has('clipboard')
|
||||||
|
call s:Echo('clipboard not available. Try :ALEInfoToFile instead.')
|
||||||
|
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
redir => l:output
|
redir => l:output
|
||||||
silent call ale#debugging#Info()
|
silent call ale#debugging#Info()
|
||||||
redir END
|
redir END
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
After:
|
||||||
|
unlet! g:output
|
||||||
|
|
||||||
|
Execute(ALEInfoToClipboard should that clipboard support is required):
|
||||||
|
" When run in the Docker image, there's no clipboard support, so this test
|
||||||
|
" will actually run.
|
||||||
|
if !has('clipboard')
|
||||||
|
let g:output = ''
|
||||||
|
|
||||||
|
redir => g:output
|
||||||
|
:ALEInfoToClipboard
|
||||||
|
redir END
|
||||||
|
|
||||||
|
AssertEqual 'clipboard not available. Try :ALEInfoToFile instead.', join(split(g:output))
|
||||||
|
endif
|
||||||
Reference in New Issue
Block a user