summaryrefslogtreecommitdiffstats
path: root/autoload/polyglot/init.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/polyglot/init.vim')
-rw-r--r--autoload/polyglot/init.vim23
1 files changed, 12 insertions, 11 deletions
diff --git a/autoload/polyglot/init.vim b/autoload/polyglot/init.vim
index 9d01b346..8af31ec2 100644
--- a/autoload/polyglot/init.vim
+++ b/autoload/polyglot/init.vim
@@ -21,19 +21,20 @@ func! polyglot#init#init()
endfunc
func! polyglot#init#is_disabled(caller, name, path)
- if g:polyglot_initialized
- return has_key(g:polyglot_is_disabled, a:name)
+ if !g:polyglot_initialized
+ if a:path[0:7] == "autoload"
+ let g:polyglot_initialized = 1
+
+ for p in globpath(&rtp, a:path, 0, 1)
+ if p != a:caller
+ exe "source " . p
+ return 1
+ endif
+ endfor
+ endif
endif
- if a:path[0:7] == "autoload"
- let g:polyglot_initialized = 1
- for p in globpath(&rtp, a:path, 0, 1)
- if p != a:caller
- exe "source " . p
- return 1
- endif
- endfor
- endif
+ return has_key(g:polyglot_is_disabled, a:name)
endfunc
let g:polyglot_is_disabled = {}