diff options
author | w0rp <devw0rp@gmail.com> | 2018-05-28 19:19:20 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-05-28 19:19:20 +0100 |
commit | f2837b5802c14e0fcdddf1af7caab0fb96858589 (patch) | |
tree | 0c603e450064f74f7998ec07bbc473b949bc13c9 /autoload/ale.vim | |
parent | cae194d1bda3ed867aaaf8d611f7de67a3f8c225 (diff) | |
download | ale-f2837b5802c14e0fcdddf1af7caab0fb96858589.zip |
#1524 - Define global variables where they are needed
Diffstat (limited to 'autoload/ale.vim')
-rw-r--r-- | autoload/ale.vim | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim index 725a3958..f31446cb 100644 --- a/autoload/ale.vim +++ b/autoload/ale.vim @@ -2,6 +2,11 @@ " Description: Primary code path for the plugin " Manages execution of linters when requested by autocommands +" Strings used for severity in the echoed message +let g:ale_echo_msg_error_str = get(g:, 'ale_echo_msg_error_str', 'Error') +let g:ale_echo_msg_info_str = get(g:, 'ale_echo_msg_info_str', 'Info') +let g:ale_echo_msg_warning_str = get(g:, 'ale_echo_msg_warning_str', 'Warning') + let s:lint_timer = -1 let s:queued_buffer_number = -1 let s:should_lint_file_for_buffer = {} @@ -32,12 +37,8 @@ function! ale#CallWithCooldown(timestamp_key, func, arglist) abort endfunction " Return 1 if a file is too large for ALE to handle. -function! ale#FileTooLarge() abort - if !exists('g:ale_maximum_file_size') - return 0 - endif - - let l:max = ale#Var(bufnr(''), 'maximum_file_size') +function! ale#FileTooLarge(buffer) abort + let l:max = getbufvar(a:buffer, 'ale_maximum_file_size', get(g:, 'ale_maximum_file_size', 0)) return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0 endfunction @@ -90,7 +91,7 @@ function! ale#ShouldDoNothing(buffer) abort endif " Do nothing if the file is too large. - if ale#FileTooLarge() + if ale#FileTooLarge(a:buffer) return 1 endif |