From 57f0454a557a1bb254fe63c583c53088b619c040 Mon Sep 17 00:00:00 2001 From: rhysd Date: Wed, 9 May 2018 23:08:39 +0900 Subject: [PATCH 1/2] Improve g:ale_set_balloons default value --- doc/ale.txt | 3 ++- plugin/ale.vim | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/ale.txt b/doc/ale.txt index 90686444..fa5e30de 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -1350,7 +1350,8 @@ g:ale_set_balloons *g:ale_set_balloons* *b:ale_set_balloons* 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 problems. Problems nearest to the cursor on the line the cursor is over will diff --git a/plugin/ale.vim b/plugin/ale.vim index d59ffd6b..a49bf68c 100644 --- a/plugin/ale.vim +++ b/plugin/ale.vim @@ -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) " 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() " See :help ale#statusline#Count() for getting status reports. From 168569b8b0af67f7d8268ab9cc6a65a2d6ceedba Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 11 May 2018 19:07:16 +0900 Subject: [PATCH 2/2] Fix condition to test a balloon feature --- test/test_ale_toggle.vader | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/test_ale_toggle.vader b/test/test_ale_toggle.vader index ca8b25d5..427000b6 100644 --- a/test/test_ale_toggle.vader +++ b/test/test_ale_toggle.vader @@ -12,7 +12,9 @@ Before: let g:ale_run_synchronously = 1 let g:ale_pattern_options = {} 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 @@ -349,7 +351,8 @@ Execute(ALEResetBuffer should reset everything for a buffer): Execute(Disabling ALE should disable balloons): " 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() " Enable balloons, so we can check the expr value. @@ -367,7 +370,8 @@ Execute(Disabling ALE should disable balloons): endif 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#balloon#Disable() ALEDisable