summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ale/sign.vim22
-rw-r--r--plugin/ale/zmain.vim5
2 files changed, 21 insertions, 6 deletions
diff --git a/plugin/ale/sign.vim b/plugin/ale/sign.vim
index 0a337bd4..3bf5552c 100644
--- a/plugin/ale/sign.vim
+++ b/plugin/ale/sign.vim
@@ -6,6 +6,7 @@ if exists('g:loaded_ale_sign')
endif
let g:loaded_ale_sign = 1
+let b:dummy_sign_set_map = {}
if !hlexists('ALEErrorSign')
highlight link ALEErrorSign error
@@ -41,7 +42,8 @@ sign define ALEDummySign
function! ale#sign#FindCurrentSigns(buffer)
" Matches output like :
" line=4 id=1 name=ALEErrorSign
- let pattern = 'id=\(\d\+\) \+name=ALE\(Warning\|Error\)Sign'
+ " строка=1 id=1000001 имя=ALEErrorSign
+ let pattern = 'id=\(\d\+\).*=ALE\(Warning\|Error\)Sign'
redir => output
silent exec 'sign place buffer=' . a:buffer
@@ -94,10 +96,14 @@ function! ale#sign#SetSigns(buffer, loclist)
let signlist = ale#sign#CombineSigns(a:loclist)
if len(signlist) > 0 || g:ale_sign_column_always
- " Insert a dummy sign if one is missing.
- execute 'sign place ' . g:ale_sign_offset
- \ . ' line=1 name=ALEDummySign buffer='
- \ . a:buffer
+ if !get(g:ale_buffer_sign_dummy_map, a:buffer, 0)
+ " Insert a dummy sign if one is missing.
+ execute 'sign place ' . g:ale_sign_offset
+ \ . ' line=1 name=ALEDummySign buffer='
+ \ . a:buffer
+
+ let g:ale_buffer_sign_dummy_map[a:buffer] = 1
+ endif
endif
" Find the current signs with the markers we use.
@@ -122,6 +128,10 @@ function! ale#sign#SetSigns(buffer, loclist)
endfor
if !g:ale_sign_column_always && len(signlist) > 0
- execute 'sign unplace ' . g:ale_sign_offset . ' buffer=' . a:buffer
+ if get(g:ale_buffer_sign_dummy_map, a:buffer, 0)
+ execute 'sign unplace ' . g:ale_sign_offset . ' buffer=' . a:buffer
+
+ let g:ale_buffer_sign_dummy_map[a:buffer] = 0
+ endif
endif
endfunction
diff --git a/plugin/ale/zmain.vim b/plugin/ale/zmain.vim
index 58e061a2..e41ff7e6 100644
--- a/plugin/ale/zmain.vim
+++ b/plugin/ale/zmain.vim
@@ -29,6 +29,7 @@ let s:job_output_map = {}
" Globals which each part of the plugin should use.
let g:ale_buffer_loclist_map = {}
let g:ale_buffer_should_reset_map = {}
+let g:ale_buffer_sign_dummy_map = {}
function! s:GetFunction(string_or_ref)
if type(a:string_or_ref) == type('')
@@ -256,6 +257,10 @@ function s:BufferCleanup(buffer)
if has_key(g:ale_buffer_loclist_map, a:buffer)
call remove(g:ale_buffer_loclist_map, a:buffer)
endif
+
+ if has_key(g:ale_buffer_sign_dummy_map, a:buffer)
+ call remove(g:ale_buffer_sign_dummy_map, a:buffer)
+ endif
endfunction
function! ALEAddLinter(filetype, linter)