diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-03-17 20:34:49 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-03-17 20:35:03 -0400 |
commit | 8394bf676b57a2675142b336101d6a81385f75d6 (patch) | |
tree | e912edda903648b8f6ffd17862c21405365a625b | |
parent | 29d6993ccdf1b5371cc11f7994a973a84bd9d40f (diff) | |
download | rneovim-8394bf676b57a2675142b336101d6a81385f75d6.tar.gz rneovim-8394bf676b57a2675142b336101d6a81385f75d6.tar.bz2 rneovim-8394bf676b57a2675142b336101d6a81385f75d6.zip |
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
-rw-r--r-- | runtime/autoload/dist/ft.vim | 12 |
1 files 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) =~ '\<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 @@ -687,7 +687,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 +713,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 |