diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-11-09 20:46:17 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-11-09 20:46:17 +0100 |
commit | 851ee6c3da5fd726d92e1e3300d7e5e2e8b907c5 (patch) | |
tree | bc273308605df9f78868b19ec193d052876bb380 /runtime/scripts.vim | |
parent | de323093e1be165a3eadd1ab3d02942358cd97bf (diff) | |
download | vim-git-851ee6c3da5fd726d92e1e3300d7e5e2e8b907c5.tar.gz |
patch 8.0.1281: loading file type detection slows down startupv8.0.1281
Problem: Loading file type detection slows down startup.
Solution: Move functions to an autoload script.
Diffstat (limited to 'runtime/scripts.vim')
-rw-r--r-- | runtime/scripts.vim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/scripts.vim b/runtime/scripts.vim index e4362c8a4..24799c428 100644 --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last change: 2017 Aug 27 +" Last change: 2017 Nov 09 " This file is called by an autocommand for every file that has just been " loaded into a buffer. It checks if the type of file can be recognized by @@ -66,19 +66,19 @@ if s:line1 =~# "^#!" " Bourne-like shell scripts: bash bash2 ksh ksh93 sh if s:name =~# '^\(bash\d*\|\|ksh\d*\|sh\)\>' - call SetFileTypeSH(s:line1) " defined in filetype.vim + call filetype#SetFileTypeSH(s:line1) " defined in filetype.vim " csh scripts elseif s:name =~# '^csh\>' if exists("g:filetype_csh") - call SetFileTypeShell(g:filetype_csh) + call filetype#SetFileTypeShell(g:filetype_csh) else - call SetFileTypeShell("csh") + call filetype#SetFileTypeShell("csh") endif " tcsh scripts elseif s:name =~# '^tcsh\>' - call SetFileTypeShell("tcsh") + call filetype#SetFileTypeShell("tcsh") " Z shell scripts elseif s:name =~# '^zsh\>' @@ -185,7 +185,7 @@ else " Bourne-like shell scripts: sh ksh bash bash2 if s:line1 =~# '^:$' - call SetFileTypeSH(s:line1) " defined in filetype.vim + call filetype#SetFileTypeSH(s:line1) " defined in filetype.vim " Z shell scripts elseif s:line1 =~# '^#compdef\>' || s:line1 =~# '^#autoload\>' || |