Merge pull request #1565 from rhysd/improve-balloon-support-detection

Improve g:ale_set_balloons default value
This commit is contained in:
w0rp 2018-05-15 13:16:33 +01:00 committed by GitHub
commit c23acb00e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 5 deletions

View File

@ -1350,7 +1350,8 @@ g:ale_set_balloons *g:ale_set_balloons*
*b:ale_set_balloons* *b:ale_set_balloons*
Type: |Number| Type: |Number|
Default: `has('balloon_eval')` Default: `has('balloon_eval') && has('gui_running') ||`
`has('balloon_eval_term') && !has('gui_running')`
When this option is set to `1`, balloon messages will be displayed for When this option is set to `1`, balloon messages will be displayed for
problems. Problems nearest to the cursor on the line the cursor is over will problems. Problems nearest to the cursor on the line the cursor is over will

View File

@ -174,7 +174,10 @@ let g:ale_echo_cursor = get(g:, 'ale_echo_cursor', 1)
let g:ale_echo_delay = get(g:, 'ale_echo_delay', 10) let g:ale_echo_delay = get(g:, 'ale_echo_delay', 10)
" This flag can be set to 0 to disable balloon support. " This flag can be set to 0 to disable balloon support.
call ale#Set('set_balloons', has('balloon_eval')) call ale#Set('set_balloons',
\ has('balloon_eval') && has('gui_running') ||
\ has('balloon_eval_term') && !has('gui_running')
\)
" A deprecated setting for ale#statusline#Status() " A deprecated setting for ale#statusline#Status()
" See :help ale#statusline#Count() for getting status reports. " See :help ale#statusline#Count() for getting status reports.

View File

@ -12,7 +12,9 @@ Before:
let g:ale_run_synchronously = 1 let g:ale_run_synchronously = 1
let g:ale_pattern_options = {} let g:ale_pattern_options = {}
let g:ale_pattern_options_enabled = 1 let g:ale_pattern_options_enabled = 1
let g:ale_set_balloons = has('balloon_eval') let g:ale_set_balloons =
\ has('balloon_eval') && has('gui_running') ||
\ has('balloon_eval_term') && !has('gui_running')
unlet! b:ale_enabled unlet! b:ale_enabled
@ -349,7 +351,8 @@ Execute(ALEResetBuffer should reset everything for a buffer):
Execute(Disabling ALE should disable balloons): Execute(Disabling ALE should disable balloons):
" These tests won't run in the console, but we can run them manually in GVim. " These tests won't run in the console, but we can run them manually in GVim.
if has('balloon_eval') if has('balloon_eval') && has('gui_running') ||
\ has('balloon_eval_term') && !has('gui_running')
call ale#linter#Reset() call ale#linter#Reset()
" Enable balloons, so we can check the expr value. " Enable balloons, so we can check the expr value.
@ -367,7 +370,8 @@ Execute(Disabling ALE should disable balloons):
endif endif
Execute(Enabling ALE should enable balloons if the setting is on): Execute(Enabling ALE should enable balloons if the setting is on):
if has('balloon_eval') if has('balloon_eval') && has('gui_running') ||
\ has('balloon_eval_term') && !has('gui_running')
call ale#linter#Reset() call ale#linter#Reset()
call ale#balloon#Disable() call ale#balloon#Disable()
ALEDisable ALEDisable