mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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
57b947e3c3
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
This commit is contained in:
parent
af112e605d
commit
ff00d583af
@ -1490,6 +1490,7 @@ local filename = {
|
|||||||
['NEWS.dch'] = 'debchangelog',
|
['NEWS.dch'] = 'debchangelog',
|
||||||
['NEWS.Debian'] = 'debchangelog',
|
['NEWS.Debian'] = 'debchangelog',
|
||||||
['/debian/control'] = 'debcontrol',
|
['/debian/control'] = 'debcontrol',
|
||||||
|
['/DEBIAN/control'] = 'debcontrol',
|
||||||
['/debian/copyright'] = 'debcopyright',
|
['/debian/copyright'] = 'debcopyright',
|
||||||
['/etc/apt/sources.list'] = 'debsources',
|
['/etc/apt/sources.list'] = 'debsources',
|
||||||
['denyhosts.conf'] = 'denyhosts',
|
['denyhosts.conf'] = 'denyhosts',
|
||||||
@ -2319,6 +2320,7 @@ local pattern = {
|
|||||||
['%.cmake%.in$'] = 'cmake',
|
['%.cmake%.in$'] = 'cmake',
|
||||||
['^crontab%.'] = starsetf('crontab'),
|
['^crontab%.'] = starsetf('crontab'),
|
||||||
['^cvs%d+$'] = 'cvs',
|
['^cvs%d+$'] = 'cvs',
|
||||||
|
['/DEBIAN/control$'] = 'debcontrol',
|
||||||
['^php%.ini%-'] = 'dosini',
|
['^php%.ini%-'] = 'dosini',
|
||||||
['^php%-fpm%.conf'] = 'dosini',
|
['^php%-fpm%.conf'] = 'dosini',
|
||||||
['^www%.conf'] = 'dosini',
|
['^www%.conf'] = 'dosini',
|
||||||
|
@ -237,7 +237,8 @@ end
|
|||||||
--- Debian Control
|
--- Debian Control
|
||||||
--- @type vim.filetype.mapfn
|
--- @type vim.filetype.mapfn
|
||||||
function M.control(_, bufnr)
|
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'
|
return 'debcontrol'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -211,7 +211,7 @@ func s:GetFilenameChecks() abort
|
|||||||
\ 'datascript': ['file.ds'],
|
\ 'datascript': ['file.ds'],
|
||||||
\ 'dcd': ['file.dcd'],
|
\ 'dcd': ['file.dcd'],
|
||||||
\ 'debchangelog': ['changelog.Debian', 'changelog.dch', 'NEWS.Debian', 'NEWS.dch', '/debian/changelog'],
|
\ 'debchangelog': ['changelog.Debian', 'changelog.dch', 'NEWS.Debian', 'NEWS.dch', '/debian/changelog'],
|
||||||
\ 'debcontrol': ['/debian/control', 'any/debian/control'],
|
\ 'debcontrol': ['/debian/control', 'any/debian/control', 'any/DEBIAN/control'],
|
||||||
\ 'debcopyright': ['/debian/copyright', 'any/debian/copyright'],
|
\ 'debcopyright': ['/debian/copyright', 'any/debian/copyright'],
|
||||||
\ 'debsources': ['/etc/apt/sources.list', '/etc/apt/sources.list.d/file.list', 'any/etc/apt/sources.list', 'any/etc/apt/sources.list.d/file.list'],
|
\ 'debsources': ['/etc/apt/sources.list', '/etc/apt/sources.list.d/file.list', 'any/etc/apt/sources.list', 'any/etc/apt/sources.list.d/file.list'],
|
||||||
\ 'deb822sources': ['/etc/apt/sources.list.d/file.sources', 'any/etc/apt/sources.list.d/file.sources'],
|
\ 'deb822sources': ['/etc/apt/sources.list.d/file.sources', 'any/etc/apt/sources.list.d/file.sources'],
|
||||||
|
Loading…
Reference in New Issue
Block a user