diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-03-19 00:03:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-19 00:03:23 +0100 |
| commit | a077f53914ac0e8eadbe2de1ccb088ed174ef818 (patch) | |
| tree | 837587215eb7cc05d5291808d6b5e2e9397005c0 /runtime/autoload | |
| parent | 29d6993ccdf1b5371cc11f7994a973a84bd9d40f (diff) | |
| parent | 14bfa0c578d8dfc3d82fe2b1ef39654bbf49b40d (diff) | |
| download | rneovim-a077f53914ac0e8eadbe2de1ccb088ed174ef818.tar.gz rneovim-a077f53914ac0e8eadbe2de1ccb088ed174ef818.tar.bz2 rneovim-a077f53914ac0e8eadbe2de1ccb088ed174ef818.zip | |
Merge #9749 from janlazo/vim-8.1.1017
Diffstat (limited to 'runtime/autoload')
| -rw-r--r-- | runtime/autoload/dist/ft.vim | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 160cdcff64..6ed39cb9f1 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -1,7 +1,7 @@ " Vim functions for file type detection " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2017 Dec 05 +" Last Change: 2019 Jan 18 " These functions are moved here from runtime/filetype.vim to make startup " faster. @@ -197,7 +197,7 @@ func dist#ft#FTe() exe 'setf ' . g:filetype_euphoria else let n = 1 - while n < 100 && n < line("$") + while n < 100 && n <= line("$") if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" setf specman return @@ -211,7 +211,7 @@ endfunc " Distinguish between HTML, XHTML and Django func dist#ft#FThtml() let n = 1 - while n < 10 && n < line("$") + while n < 10 && n <= line("$") if getline(n) =~ '\<DTD\s\+XHTML\s' setf xhtml return @@ -222,13 +222,13 @@ func dist#ft#FThtml() endif let n = n + 1 endwhile - setf html + setf FALLBACK html endfunc " Distinguish between standard IDL and MS-IDL func dist#ft#FTidl() let n = 1 - while n < 50 && n < line("$") + while n < 50 && n <= line("$") if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"' setf msidl return @@ -484,6 +484,10 @@ endfunc " Called from filetype.vim and scripts.vim. func dist#ft#SetFileTypeSH(name) + if did_filetype() + " Filetype was already detected + return + endif if expand("<amatch>") =~ g:ft_ignore_pat return endif @@ -531,6 +535,10 @@ endfunc " as used for Tcl. " Also called from scripts.vim, thus can't be local to this script. func dist#ft#SetFileTypeShell(name) + if did_filetype() + " Filetype was already detected + return + endif if expand("<amatch>") =~ g:ft_ignore_pat return endif @@ -551,6 +559,10 @@ func dist#ft#SetFileTypeShell(name) endfunc func dist#ft#CSH() + if did_filetype() + " Filetype was already detected + return + endif if exists("g:filetype_csh") call dist#ft#SetFileTypeShell(g:filetype_csh) elseif &shell =~ "tcsh" @@ -687,7 +699,7 @@ endfunc func dist#ft#FTxml() let n = 1 - while n < 100 && n < line("$") + while n < 100 && n <= line("$") let line = getline(n) " DocBook 4 or DocBook 5. let is_docbook4 = line =~ '<!DOCTYPE.*DocBook' @@ -713,7 +725,7 @@ endfunc func dist#ft#FTy() let n = 1 - while n < 100 && n < line("$") + while n < 100 && n <= line("$") let line = getline(n) if line =~ '^\s*%' setf yacc |