summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2020-01-01 18:21:00 +0000
committerGitHub <noreply@github.com>2020-01-01 18:21:00 +0000
commit25e457595a9bbf55956d5cff604824471bd8fff8 (patch)
tree635faa69fe446c4c00da0e9314baaf0d7984744a
parent5f84325cd811ec179b7f3642652438c6a45b174d (diff)
parent31d6f72abf5c025374a60675e7db8d8c97c9f775 (diff)
downloadale-25e457595a9bbf55956d5cff604824471bd8fff8.zip
Merge pull request #2828 from akhilman/hover-to-preview
Add option to show hover messages in preview.
-rw-r--r--autoload/ale/hover.vim10
-rw-r--r--plugin/ale.vim3
2 files changed, 13 insertions, 0 deletions
diff --git a/autoload/ale/hover.vim b/autoload/ale/hover.vim
index 2af35aa4..8fdd288c 100644
--- a/autoload/ale/hover.vim
+++ b/autoload/ale/hover.vim
@@ -42,6 +42,11 @@ function! ale#hover#HandleTSServerResponse(conn_id, response) abort
\&& exists('*balloon_show')
\&& ale#Var(l:options.buffer, 'set_balloons')
call balloon_show(a:response.body.displayString)
+ elseif g:ale_hover_to_preview
+ call ale#preview#Show(split(a:response.body.displayString, "\n"), {
+ \ 'filetype': 'ale-preview.message',
+ \ 'stay_here': 1,
+ \})
else
call ale#util#ShowMessage(a:response.body.displayString)
endif
@@ -98,6 +103,11 @@ function! ale#hover#HandleLSPResponse(conn_id, response) abort
\&& exists('*balloon_show')
\&& ale#Var(l:options.buffer, 'set_balloons')
call balloon_show(l:str)
+ elseif g:ale_hover_to_preview
+ call ale#preview#Show(split(l:str, "\n"), {
+ \ 'filetype': 'ale-preview.message',
+ \ 'stay_here': 1,
+ \})
else
call ale#util#ShowMessage(l:str)
endif
diff --git a/plugin/ale.vim b/plugin/ale.vim
index 1912a9c0..8fea3bb4 100644
--- a/plugin/ale.vim
+++ b/plugin/ale.vim
@@ -125,6 +125,9 @@ let g:ale_close_preview_on_insert = get(g:, 'ale_close_preview_on_insert', 0)
" This flag can be set to 0 to disable balloon support.
let g:ale_set_balloons = get(g:, 'ale_set_balloons', has('balloon_eval') && has('gui_running'))
+" Use preview window for hover messages.
+let g:ale_hover_to_preview = get(g:, 'ale_hover_to_preview', 0)
+
" This flag can be set to 0 to disable warnings for trailing whitespace
let g:ale_warn_about_trailing_whitespace = get(g:, 'ale_warn_about_trailing_whitespace', 1)
" This flag can be set to 0 to disable warnings for trailing blank lines