To: vim_dev@googlegroups.com Subject: Patch 8.1.1017 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1017 Problem: Off-by-one error in filetype detection. Solution: Also check the last line of the file. Files: runtime/autoload/dist/ft.vim *** ../vim-8.1.1016/runtime/autoload/dist/ft.vim 2019-01-18 21:45:14.593232311 +0100 --- runtime/autoload/dist/ft.vim 2019-03-08 07:47:10.095812063 +0100 *************** *** 197,203 **** exe 'setf ' . g:filetype_euphoria else let n = 1 ! while n < 100 && n < line("$") if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" setf specman return --- 197,203 ---- exe 'setf ' . g:filetype_euphoria else let n = 1 ! while n < 100 && n <= line("$") if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" setf specman return *************** *** 211,217 **** " Distinguish between HTML, XHTML and Django func dist#ft#FThtml() let n = 1 ! while n < 10 && n < line("$") if getline(n) =~ '\