From 40e69794eb0c2f00843b5b0289ab7751986624a6 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 14 Oct 2017 17:31:58 +0100 Subject: Make the getcmdwintype() check ever-so-slightly faster --- autoload/ale.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3