aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/filetype
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-11-24 15:05:48 +0100
committerChristian Clason <ch.clason+github@icloud.com>2024-11-25 00:05:12 +0100
commitff00d583af8f1ce21a508d701d09c54d2621b16e (patch)
tree860f72c5fc9e3e798c9337c7676f9726c1b55477 /runtime/lua/vim/filetype
parentaf112e605d4d8f3015744b69ec7544d732f8dad9 (diff)
downloadrneovim-ff00d583af8f1ce21a508d701d09c54d2621b16e.tar.gz
rneovim-ff00d583af8f1ce21a508d701d09c54d2621b16e.tar.bz2
rneovim-ff00d583af8f1ce21a508d701d09c54d2621b16e.zip
vim-patch:9.1.0886: filetype: debian control file not detected
Problem: filetype: debian control file not detected Solution: detect 'debian/control' files as debcontrol filetype (author) closes: vim/vim#16067 https://github.com/vim/vim/commit/57b947e3c3b8d52b914158979263855d785445d5 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Diffstat (limited to 'runtime/lua/vim/filetype')
-rw-r--r--runtime/lua/vim/filetype/detect.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua
index 81b94c69db..4f2fef5b1f 100644
--- a/runtime/lua/vim/filetype/detect.lua
+++ b/runtime/lua/vim/filetype/detect.lua
@@ -237,7 +237,8 @@ end
--- Debian Control
--- @type vim.filetype.mapfn
function M.control(_, bufnr)
- if getline(bufnr, 1):find('^Source:') then
+ local line1 = getline(bufnr, 1)
+ if line1 and findany(line1, { '^Source:', '^Package:' }) then
return 'debcontrol'
end
end