summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-14 17:31:58 +0100
committerw0rp <devw0rp@gmail.com>2017-10-14 17:31:58 +0100
commit40e69794eb0c2f00843b5b0289ab7751986624a6 (patch)
tree8b705dd1ec4cfd714c36bdabb27ee05c352e92bb
parentd8ea83e344baf2844e962dd08aac70a919d475f3 (diff)
downloadale-40e69794eb0c2f00843b5b0289ab7751986624a6.zip
Make the getcmdwintype() check ever-so-slightly faster
-rw-r--r--autoload/ale.vim4
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