mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
vim-patch:9.0.0055 (#19392)
vim-patch:9.0.0055: bitbake files are not detected
Problem: Bitbake files are not detected.
Solution: Add bitbake filetype detection by file name and contents. (Gregory
Anders, closes vim/vim#10697)
fa49eb4827
This commit is contained in:
@@ -172,6 +172,9 @@ local extension = {
|
||||
return require('vim.filetype.detect').bindzone(bufnr, '')
|
||||
end,
|
||||
bicep = 'bicep',
|
||||
bb = 'bitbake',
|
||||
bbappend = 'bitbake',
|
||||
bbclass = 'bitbake',
|
||||
bl = 'blank',
|
||||
bsdl = 'bsdl',
|
||||
bst = 'bst',
|
||||
@@ -1662,6 +1665,9 @@ local pattern = {
|
||||
['[mM]akefile%.am'] = 'automake',
|
||||
['.*/bind/db%..*'] = starsetf('bindzone'),
|
||||
['.*/named/db%..*'] = starsetf('bindzone'),
|
||||
['.*/build/conf/.*%.conf'] = 'bitbake',
|
||||
['.*/meta/conf/.*%.conf'] = 'bitbake',
|
||||
['.*/meta%-.*/conf/.*%.conf'] = 'bitbake',
|
||||
['.*bsd'] = 'bsdl',
|
||||
['bzr_log%..*'] = 'bzr',
|
||||
['.*enlightenment/.*%.cfg'] = 'c',
|
||||
|
||||
@@ -62,7 +62,7 @@ end
|
||||
-- Checks the first 5 lines for a asmsyntax=foo override.
|
||||
-- Only whitespace characters can be present immediately before or after this statement.
|
||||
function M.asm_syntax(bufnr)
|
||||
local lines = table.concat(getlines(bufnr, 1, 5), ' '):lower()
|
||||
local lines = ' ' .. table.concat(getlines(bufnr, 1, 5), ' '):lower() .. ' '
|
||||
local match = lines:match('%sasmsyntax=([a-zA-Z0-9]+)%s')
|
||||
if match then
|
||||
return match
|
||||
@@ -554,6 +554,8 @@ function M.inc(bufnr)
|
||||
-- headers so assume POV-Ray
|
||||
elseif findany(lines, { '^%s{', '^%s%(%*' }) or matchregex(lines, pascal_keywords) then
|
||||
return 'pascal'
|
||||
elseif findany(lines, { '^%s*inherit ', '^%s*require ', '^%s*%w+%s+= ' }) then
|
||||
return 'bitbake'
|
||||
else
|
||||
local syntax = M.asm_syntax(bufnr)
|
||||
if not syntax or syntax == '' then
|
||||
|
||||
Reference in New Issue
Block a user