diff options
author | w0rp <devw0rp@gmail.com> | 2017-05-05 23:03:19 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-05-05 23:03:19 +0100 |
commit | ab9afaa2bf446ed9db32f5ab43081e7f28cc1358 (patch) | |
tree | 56077678593f81b2b981fcaab81a373358f6fc60 /autoload/ale.vim | |
parent | 6b15c7c9fd56edf1d63bc92c81c86afb7f6d3b6e (diff) | |
download | ale-ab9afaa2bf446ed9db32f5ab43081e7f28cc1358.zip |
Add a has() wrapper we can override for tests, and add a function for generating paths up to the root directory to search through
Diffstat (limited to 'autoload/ale.vim')
-rw-r--r-- | autoload/ale.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim index b9cd648f..c8fbfdfc 100644 --- a/autoload/ale.vim +++ b/autoload/ale.vim @@ -105,6 +105,14 @@ function! ale#ResetLintFileMarkers() abort let s:should_lint_file_for_buffer = {} endfunction +let g:ale_has_override = get(g:, 'ale_has_override', {}) + +" Call has(), but check a global Dictionary so we can force flags on or off +" for testing purposes. +function! ale#Has(feature) abort + return get(g:ale_has_override, a:feature, has(a:feature)) +endfunction + " Given a buffer number and a variable name, look for that variable in the " buffer scope, then in global scope. If the name does not exist in the global " scope, an exception will be thrown. |