]> granicus.if.org Git - vim/commitdiff
patch 8.0.0650: for extra help files the filetype is set more than once v8.0.0650
authorBram Moolenaar <Bram@vim.org>
Thu, 22 Jun 2017 12:47:22 +0000 (14:47 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 22 Jun 2017 12:47:22 +0000 (14:47 +0200)
Problem:    For extra help files the filetype is set more than once.
Solution:   In *.txt files check that there is no help file modline.

runtime/filetype.vim
src/version.c

index d676329bdd5dc5ed23b66e573418f5acb0d0e406..0fb6596189b38efd700060bd9d24ab5ca1d7cee4 100644 (file)
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2017 Jun 20
+" Last Change: 2017 Jun 22
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -2789,7 +2789,13 @@ au BufNewFile,BufRead zsh*,zlog*         call s:StarSetf('zsh')
 
 " Plain text files, needs to be far down to not override others.  This avoids
 " the "conf" type being used if there is a line starting with '#'.
-au BufNewFile,BufRead *.txt,*.text,README      setf text
+au BufNewFile,BufRead *.text,README            setf text
+
+" Help files match *.txt but should have a last line that is a modeline.
+au BufNewFile,BufRead *.txt    
+       \  if getline('$') !~ 'vim:.*ft=help'
+       \|   setf text
+       \| endif
 
 
 " Use the filetype detect plugins.  They may overrule any of the previously
index 47e1da5eca2569d59c608cd34ed964ad085ba4a5..684899eaa06148b0fa908a147327c82ab456cea7 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    650,
 /**/
     649,
 /**/