diff --git a/plugin/ale/aaflags.vim b/plugin/ale/aaflags.vim index f18dcc4..56ed417 100644 --- a/plugin/ale/aaflags.vim +++ b/plugin/ale/aaflags.vim @@ -8,6 +8,13 @@ endif let g:loaded_ale_flags = 1 +" A flag for detecting if the required features are set. +if has('nvim') + let g:ale_has_required_features = has('timers') +else + let g:ale_has_required_features = has('timers') && has('job') && has('channel') +endif + " This flag can be set to 0 to disable linting when text is changed. let g:ale_lint_on_text_changed = get(g:, 'ale_lint_on_text_changed', 1) @@ -45,7 +52,7 @@ let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', 0) " * The 1st element is for errors " * The 2nd element is for warnings " * The 3rd element is when there are no errors -let g:ale_statusline_format = get(g:, 'ale_statusline_format', +let g:ale_statusline_format = get(g:, 'ale_statusline_format', \ ['%d error(s)', '%d warning(s)', 'OK'] \) diff --git a/plugin/ale/cursor.vim b/plugin/ale/cursor.vim index 24f1f18..0615971 100644 --- a/plugin/ale/cursor.vim +++ b/plugin/ale/cursor.vim @@ -117,7 +117,7 @@ function! ale#cursor#EchoCursorWarningWithDelay() let s:cursor_timer = timer_start(10, function('ale#cursor#EchoCursorWarning')) endfunction -if g:ale_echo_cursor +if g:ale_has_required_features && g:ale_echo_cursor augroup ALECursorGroup autocmd! autocmd CursorMoved,CursorHold * call ale#cursor#EchoCursorWarningWithDelay() diff --git a/plugin/ale/zmain.vim b/plugin/ale/zmain.vim index a918f66..117f735 100644 --- a/plugin/ale/zmain.vim +++ b/plugin/ale/zmain.vim @@ -407,9 +407,9 @@ endfunction " Load all of the linters for each filetype. runtime! ale_linters/*/*.vim -if !has('nvim') && !(has('timers') && has('job') && has('channel')) - echoerr 'ALE requires NeoVim or Vim 8 with +timers +job +channel' - echoerr 'ALE will not be run automatically' +if !g:ale_has_required_features + echoerr 'ALE requires NeoVim >= 0.1.5 or Vim 8 with +timers +job +channel' + echoerr 'Please update your editor appropriately.' finish endif