Make the getcmdwintype() check ever-so-slightly faster

This commit is contained in:
w0rp 2017-10-14 17:31:58 +01:00
parent d8ea83e344
commit 40e69794eb
1 changed files with 3 additions and 1 deletions

View File

@ -38,6 +38,8 @@ function! ale#FileTooLarge() abort
return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0
endfunction
let s:getcmdwintype_exists = exists('*getcmdwintype')
" A function for checking various conditions whereby ALE just shouldn't
" attempt to do anything, say if particular buffer types are open in Vim.
function! ale#ShouldDoNothing(buffer) abort
@ -50,7 +52,7 @@ function! ale#ShouldDoNothing(buffer) abort
endif
" Do nothing if running from command mode
if exists('*getcmdwintype') && !empty(getcmdwintype())
if s:getcmdwintype_exists && !empty(getcmdwintype())
return 1
endif