From 8394bf676b57a2675142b336101d6a81385f75d6 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 17 Mar 2019 20:34:49 -0400 Subject: vim-patch:8.1.1017: off-by-one error in filetype detection Problem: Off-by-one error in filetype detection. Solution: Also check the last line of the file. https://github.com/vim/vim/commit/493fbe4abee660d30b4f2aef87b754b0a720213c --- runtime/autoload/dist/ft.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'runtime/autoload') diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 160cdcff64..fe5184cd45 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -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) =~ '\ Date: Sun, 17 Mar 2019 20:37:45 -0400 Subject: vim-patch:8.1.0771: some shell filetype patterns end in a star Problem: Some shell filetype patterns end in a star. Solution: Make sure that patterns not ending in a star are preferred. https://github.com/vim/vim/commit/147e7d0caba8b66ff11622e514142bcc3d24403a --- runtime/autoload/dist/ft.vim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'runtime/autoload') diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index fe5184cd45..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 -" Last Change: 2017 Dec 05 +" Last Change: 2019 Jan 18 " These functions are moved here from runtime/filetype.vim to make startup " faster. @@ -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("") =~ 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("") =~ 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" -- cgit