aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/insert.txt2
-rw-r--r--runtime/lua/vim/filetype.lua8
2 files changed, 8 insertions, 2 deletions
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index b77339a325..31e6dd1ec4 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -643,7 +643,7 @@ Also see the 'infercase' option if you want to adjust the case of the match.
When inserting a selected candidate word from the |popup-menu|, the part of
the candidate word that does not match the query is highlighted using
-|hl-ComplMatchIns|. If fuzzy is enabled in 'completeopt', highlighting will
+|hl-ComplMatchIns|. If fuzzy is enabled in 'completeopt', highlighting will
not be applied.
*complete_CTRL-E*
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 2c058bc6bf..b2ddd461cc 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -2415,7 +2415,13 @@ local pattern = {
['/boot/grub/menu%.lst$'] = 'grub',
-- gtkrc* and .gtkrc*
['^%.?gtkrc'] = starsetf('gtkrc'),
- ['^${VIMRUNTIME}/doc/.*%.txt$'] = 'help',
+ ['/doc/.*%.txt$'] = function(_, bufnr)
+ local line = M._getline(bufnr, -1)
+ local ml = line:find('^vim:') or line:find('%svim:')
+ if ml and M._matchregex(line:sub(ml), [[\<\(ft\|filetype\)=help\>]]) then
+ return 'help'
+ end
+ end,
['^hg%-editor%-.*%.txt$'] = 'hgcommit',
['%.html%.m4$'] = 'htmlm4',
['^JAM.*%.'] = starsetf('jam'),