summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-22 14:47:22 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-22 14:47:22 +0200
commit868831f1224cfc17a4de21fb7386873254592308 (patch)
tree2c8cbfa37feb366a04a4ec18bc4e92ae89d3e299 /runtime
parent9049298f8d0bbc237b7c666c7ad6cdabe738e8fc (diff)
downloadvim-868831f1224cfc17a4de21fb7386873254592308.zip
patch 8.0.0650: for extra help files the filetype is set more than once
Problem: For extra help files the filetype is set more than once. Solution: In *.txt files check that there is no help file modline.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/filetype.vim10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index d676329bd..0fb659618 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -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