Fix #506 - Don't set signs for buffers which don't exist

This commit is contained in:
w0rp 2017-04-26 23:31:43 +01:00
parent ce2f777e33
commit b25dbd6ea5
2 changed files with 9 additions and 0 deletions

View File

@ -169,6 +169,12 @@ endfunction
" This function will set the signs which show up on the left.
function! ale#sign#SetSigns(buffer, loclist) abort
if !bufexists(str2nr(a:buffer))
" Stop immediately when attempting to set signs for a buffer which
" does not exist.
return
endif
" Find the current markers
let l:current_sign_list = ale#sign#FindCurrentSigns(a:buffer)

View File

@ -132,3 +132,6 @@ Execute(Loclist items with sign_id values should be kept):
\ ['16', '1000004', 'ALEErrorSign'],
\ ],
\ ParseSigns()
Execute(No excpetions should be thrown when setting signs for invalid buffers):
call ale#sign#SetSigns(123456789, [{'lnum': 15, 'col': 2, 'type': 'W', 'text': 'e'}])