summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-26 12:26:16 +0100
committerw0rp <devw0rp@gmail.com>2017-10-26 12:26:16 +0100
commitf15c8f41279b8b8d9e397e55021d31ca983da3b0 (patch)
tree7984ce8f8723ce72f00a3ab5a14914dfb9cb6dee
parent0702cb59b7099bc2f0ea224457d3c0d31bddf8ca (diff)
downloadale-f15c8f41279b8b8d9e397e55021d31ca983da3b0.zip
#1049 Do not modify runtimepath if the conflict warnings are disabled
-rw-r--r--doc/ale.txt5
-rw-r--r--plugin/ale.vim12
2 files changed, 12 insertions, 5 deletions
diff --git a/doc/ale.txt b/doc/ale.txt
index 4480ce97..1bc639b8 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -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
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*
*b:ale_enabled*
diff --git a/plugin/ale.vim b/plugin/ale.vim
index a0d9b271..52b3059b 100644
--- a/plugin/ale.vim
+++ b/plugin/ale.vim
@@ -32,8 +32,13 @@ if !s:has_features
finish
endif
-" Add the after directory to the runtimepath
-let &runtimepath .= ',' . expand('<sfile>:p:h:h') . '/after'
+" 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)
+
+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.
let g:loaded_ale = 1
@@ -44,9 +49,6 @@ if has('unix') && empty($TMPDIR)
let $TMPDIR = '/tmp'
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
" each buffer which linters are being run against.
let g:ale_buffer_info = {}