summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2016-09-26 16:47:26 +0100
committerGitHub <noreply@github.com>2016-09-26 16:47:26 +0100
commit31f4601fcf3633e8bdc507682ce2b7d59699d5db (patch)
treed396fce660cb5a46e61ef879bfb2d329fb3656b6 /plugin
parent937e9792708bf173aab53bdc7134f47f4db9e603 (diff)
parentbad240d659ea9ce063d7f8599de1573d1e87646a (diff)
downloadale-31f4601fcf3633e8bdc507682ce2b7d59699d5db.zip
Merge pull request #13 from vmarovic/master
Option to keep sign column always open
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ale/aaflags.vim5
-rw-r--r--plugin/ale/sign.vim11
-rw-r--r--plugin/ale/zmain.vim2
3 files changed, 18 insertions, 0 deletions
diff --git a/plugin/ale/aaflags.vim b/plugin/ale/aaflags.vim
index 4fc74b4e..9f022beb 100644
--- a/plugin/ale/aaflags.vim
+++ b/plugin/ale/aaflags.vim
@@ -45,3 +45,8 @@ endif
if !exists('g:ale_warn_about_trailing_whitespace')
let g:ale_warn_about_trailing_whitespace = 1
endif
+
+" This flag can be set to 1 to keep sign gutter always open
+if !exists('g:ale_sign_column_always')
+ let g:ale_sign_column_always = 0
+endif
diff --git a/plugin/ale/sign.vim b/plugin/ale/sign.vim
index 999e3a65..322b2362 100644
--- a/plugin/ale/sign.vim
+++ b/plugin/ale/sign.vim
@@ -50,6 +50,8 @@ function! ale#sign#SetSigns(buffer, loclist)
endif
endfor
+ call ale#sign#InsertDummy(len(signlist))
+
for i in range(0, len(signlist) - 1)
let obj = signlist[i]
let name = obj['type'] ==# 'W' ? 'ALEWarningSign' : 'ALEErrorSign'
@@ -62,3 +64,12 @@ function! ale#sign#SetSigns(buffer, loclist)
exec sign_line
endfor
endfunction
+
+" Show signd gutter if there is no signs and g:ale_sign_column_alwas is set to 1
+function! ale#sign#InsertDummy(no_signs)
+ if g:ale_sign_column_always == 1 && a:no_signs == 0
+ sign define ale_keep_open_dummy
+ execute 'sign place 9999 line=1 name=ale_keep_open_dummy buffer=' . bufnr('')
+ endif
+endfunction
+
diff --git a/plugin/ale/zmain.vim b/plugin/ale/zmain.vim
index 2229c34c..8ec1c955 100644
--- a/plugin/ale/zmain.vim
+++ b/plugin/ale/zmain.vim
@@ -297,6 +297,8 @@ function! ALELint(delay)
if a:delay > 0
let s:lint_timer = timer_start(a:delay, function('s:TimerHandler'))
else
+ " Show empty gutter if g:ale_sign_column_always = 1
+ call ale#sign#InsertDummy(0)
call s:TimerHandler()
endif
endfunction