diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-08-20 19:41:31 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-08-21 22:03:28 -0400 |
commit | 45cc14d9a5c1d5eadf817c920de5f913bbc4d772 (patch) | |
tree | 4b9323d02836cbd5115418bd1ff9b1272e2edda9 | |
parent | ed49d9d866f8260842ea177fa9ce31dbc398701d (diff) | |
download | rneovim-45cc14d9a5c1d5eadf817c920de5f913bbc4d772.tar.gz rneovim-45cc14d9a5c1d5eadf817c920de5f913bbc4d772.tar.bz2 rneovim-45cc14d9a5c1d5eadf817c920de5f913bbc4d772.zip |
CheckHealth: Remove "disable"/"enable" concept
We can add this later if it is proven necessary, but it should not be
because:
1. User can run a subset of checkers via `:CheckHealth plugin1, ...,`
2. Healthcheck is a very rare operation. Optimizing it is not worth the
code/API complexity.
-rw-r--r-- | runtime/autoload/health.vim | 63 |
1 files changed, 1 insertions, 62 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index d2f36b2f65..6ba9405e0a 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -1,8 +1,3 @@ -" Dictionary of all health check functions we have found. -" They will only be run if the value is true -let g:health_checkers = get(g:, 'health_checkers', {}) -let s:current_checker = get(s:, 'current_checker', '') - function! s:enhance_syntax() abort syntax keyword healthError ERROR highlight link healthError Error @@ -51,7 +46,7 @@ function! health#check(plugin_names) abort endfor endif - new + tabnew setlocal bufhidden=wipe set filetype=markdown call s:enhance_syntax() @@ -128,62 +123,6 @@ function! health#report_error(msg, ...) abort " {{{ endif endfunction " }}} -" Adds a health checker. Does nothing if the checker already exists. -function! s:add_single_checker(checker_name) abort " {{{ - if has_key(g:health_checkers, a:checker_name) - return - else - let g:health_checkers[a:checker_name] = v:true - endif -endfunction " }}} - -" Enables a health checker. -function! s:enable_single_checker(checker_name) abort " {{{ - let g:health_checkers[a:checker_name] = v:true -endfunction " }}} - -" Disables a health checker. -function! s:disable_single_checker(checker_name) abort " {{{ - let g:health_checkers[a:checker_name] = v:false -endfunction " }}} - - -" Adds a health checker. `checker_name` can be a list of strings or -" a single string. Does nothing if the checker already exists. -function! health#add_checker(checker_name) abort " {{{ - if type(a:checker_name) == type('') - call s:add_single_checker(a:checker_name) - elseif type(a:checker_name) == type([]) - for checker in a:checker_name - call s:add_single_checker(checker) - endfor - endif -endfunction " }}} - -" Enables a health checker. `checker_name` can be a list of strings or -" a single string. -function! health#enable_checker(checker_name) abort " {{{ - if type(a:checker_name) == type('') - call s:enable_single_checker(a:checker_name) - elseif type(a:checker_name) == type([]) - for checker in a:checker_name - call s:enable_single_checker(checker) - endfor - endif -endfunction " }}} - -" Disables a health checker. `checker_name` can be a list of strings or -" a single string. -function! health#disable_checker(checker_name) abort " {{{ - if type(a:checker_name) == type('') - call s:disable_single_checker(a:checker_name) - elseif type(a:checker_name) == type([]) - for checker in a:checker_name - call s:disable_single_checker(checker) - endfor - endif -endfunction " }}} - function! s:filepath_to_function(name) abort return substitute(substitute(substitute(a:name, ".*autoload/", "", ""), \ "\\.vim", "#check", ""), "/", "#", "g") |