summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoload/ale/hover.vim10
-rw-r--r--doc/ale.txt17
-rw-r--r--plugin/ale.vim3
3 files changed, 28 insertions, 2 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/doc/ale.txt b/doc/ale.txt
index 847a9777..e58b01bf 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -525,6 +525,9 @@ the mouse over a symbol in a buffer. Diagnostic information will take priority
over hover information for balloons. If a line contains a problem, that
problem will be displayed in a balloon instead of hover information.
+Hover information can be displayed in the preview window instead by setting
+|g:ale_hover_to_preview| to `1`.
+
For Vim 8.1+ terminals, mouse hovering is disabled by default. Enabling
|balloonexpr| commands in terminals can cause scrolling issues in terminals,
so ALE will not attempt to show balloons unless |g:ale_set_balloons| is set to
@@ -1023,6 +1026,16 @@ g:ale_history_log_output *g:ale_history_log_output*
if you want to save on some memory usage.
+g:ale_hover_to_preview *g:ale_hover_to_preview*
+ *b:ale_hover_to_preview*
+
+ Type: |Number|
+ Default: `0`
+
+ If set to `1`, hover messages will be displayed in the preview window,
+ instead of in balloons or the message line.
+
+
g:ale_keep_list_window_open *g:ale_keep_list_window_open*
*b:ale_keep_list_window_open*
Type: |Number|
@@ -1337,7 +1350,7 @@ b:ale_loclist_msg_format *b:ale_loclist_msg_format*
The strings for configuring `%severity%` are also used for this option.
-g:ale_lsp_show_message_format *g:ale_lsp_show_message_format*
+g:ale_lsp_show_message_format *g:ale_lsp_show_message_format*
Type: |String|
Default: `'%severity%:%linter%: %s'`
@@ -1359,7 +1372,7 @@ g:ale_lsp_show_message_format *g:ale_lsp_show_message_
separately for each buffer like |g:ale_echo_msg_format| can.
-g:ale_lsp_show_message_severity *g:ale_lsp_show_message_severity*
+g:ale_lsp_show_message_severity *g:ale_lsp_show_message_severity*
Type: |String|
Default: `'error'`
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