#1049 Do not modify runtimepath if the conflict warnings are disabled

This commit is contained in:
w0rp 2017-10-26 12:26:16 +01:00
parent 0702cb59b7
commit f15c8f4127
2 changed files with 12 additions and 5 deletions

View File

@ -624,6 +624,11 @@ g:ale_emit_conflict_warnings *g:ale_emit_conflict_warnings*
When set to `0`, ALE will not emit any warnings on startup about conflicting When set to `0`, ALE will not emit any warnings on startup about conflicting
plugins. ALE will probably not work if other linting plugins are installed. plugins. ALE will probably not work if other linting plugins are installed.
When this option is set to `1`, ALE will add its `after` directory to
|runtimepath| automatically, so the checks can be applied. Setting this
option to `0` before ALE is loaded will prevent ALE from modifying
|runtimepath|.
g:ale_enabled *g:ale_enabled* g:ale_enabled *g:ale_enabled*
*b:ale_enabled* *b:ale_enabled*

View File

@ -32,8 +32,13 @@ if !s:has_features
finish finish
endif endif
" Add the after directory to the runtimepath " This flag can be set to 0 to disable emitting conflict warnings.
let &runtimepath .= ',' . expand('<sfile>:p:h:h') . '/after' let g:ale_emit_conflict_warnings = get(g:, 'ale_emit_conflict_warnings', 1)
if g:ale_emit_conflict_warnings
" Add the after directory to the runtimepath
let &runtimepath .= ',' . expand('<sfile>:p:h:h') . '/after'
endif
" Set this flag so that other plugins can use it, like airline. " Set this flag so that other plugins can use it, like airline.
let g:loaded_ale = 1 let g:loaded_ale = 1
@ -44,9 +49,6 @@ if has('unix') && empty($TMPDIR)
let $TMPDIR = '/tmp' let $TMPDIR = '/tmp'
endif endif
" This flag can be set to 0 to disable emitting conflict warnings.
let g:ale_emit_conflict_warnings = get(g:, 'ale_emit_conflict_warnings', 1)
" This global variable is used internally by ALE for tracking information for " This global variable is used internally by ALE for tracking information for
" each buffer which linters are being run against. " each buffer which linters are being run against.
let g:ale_buffer_info = {} let g:ale_buffer_info = {}