diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-03-11 06:23:12 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-03-11 06:24:57 +0800 |
commit | 4533c40786a68d57b878babd46ea70e761392cf0 (patch) | |
tree | a6dba157e101e0e63327d20ae431e43c6a88f885 /runtime/lua/vim | |
parent | 4281a514e9b751a5a83b29659bdcc9dd8fcd5d06 (diff) | |
download | rneovim-4533c40786a68d57b878babd46ea70e761392cf0.tar.gz rneovim-4533c40786a68d57b878babd46ea70e761392cf0.tar.bz2 rneovim-4533c40786a68d57b878babd46ea70e761392cf0.zip |
vim-patch:9.1.1194: filetype: false positive help filetype detection
Problem: filetype: false positive help filetype detection
Solution: Only detect a file as help if modeline appears either at start
of line or is preceded by whitespace (zeertzjq).
closes: vim/vim#16845
https://github.com/vim/vim/commit/6763b0ee95e7e66ab7992653fbba48691e803e70
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r-- | runtime/lua/vim/filetype.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 4c6b3b108f..b2ddd461cc 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2417,7 +2417,7 @@ local pattern = { ['^%.?gtkrc'] = starsetf('gtkrc'), ['/doc/.*%.txt$'] = function(_, bufnr) local line = M._getline(bufnr, -1) - local ml = line:find('vim:') + local ml = line:find('^vim:') or line:find('%svim:') if ml and M._matchregex(line:sub(ml), [[\<\(ft\|filetype\)=help\>]]) then return 'help' end |