diff options
author | w0rp <devw0rp@gmail.com> | 2017-10-14 17:31:58 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-10-14 17:31:58 +0100 |
commit | 40e69794eb0c2f00843b5b0289ab7751986624a6 (patch) | |
tree | 8b705dd1ec4cfd714c36bdabb27ee05c352e92bb /autoload | |
parent | d8ea83e344baf2844e962dd08aac70a919d475f3 (diff) | |
download | ale-40e69794eb0c2f00843b5b0289ab7751986624a6.zip |
Make the getcmdwintype() check ever-so-slightly faster
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale.vim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim index 3bc38cf8..0f916c22 100644 --- a/autoload/ale.vim +++ b/autoload/ale.vim @@ -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 |