mirror of https://github.com/dense-analysis/ale
#1621 - Tolerate SetOptions calls when ALE is loaded in a weird way
This commit is contained in:
parent
fae9167083
commit
014d27c882
|
@ -23,7 +23,8 @@ function! s:CmpPatterns(left_item, right_item) abort
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#pattern_options#SetOptions(buffer) abort
|
function! ale#pattern_options#SetOptions(buffer) abort
|
||||||
if !g:ale_pattern_options_enabled || empty(g:ale_pattern_options)
|
if !get(g:, 'ale_pattern_options_enabled', 0)
|
||||||
|
\|| empty(get(g:, 'ale_pattern_options', 0))
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -90,3 +90,14 @@ Execute(Patterns should be applied after the Dictionary changes):
|
||||||
call ale#pattern_options#SetOptions(bufnr(''))
|
call ale#pattern_options#SetOptions(bufnr(''))
|
||||||
|
|
||||||
AssertEqual 666, b:some_option
|
AssertEqual 666, b:some_option
|
||||||
|
|
||||||
|
Execute(SetOptions should tolerate settings being unset):
|
||||||
|
" This might happen if ALE is loaded in a weird way, so tolerate it.
|
||||||
|
unlet! g:ale_pattern_options
|
||||||
|
unlet! g:ale_pattern_options_enabled
|
||||||
|
|
||||||
|
call ale#pattern_options#SetOptions(bufnr(''))
|
||||||
|
|
||||||
|
let g:ale_pattern_options_enabled = 1
|
||||||
|
|
||||||
|
call ale#pattern_options#SetOptions(bufnr(''))
|
||||||
|
|
Loading…
Reference in New Issue