From 8394bf676b57a2675142b336101d6a81385f75d6 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 17 Mar 2019 20:34:49 -0400 Subject: [PATCH] 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(-) 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) =~ '\