diff options
| author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2022-07-17 06:33:51 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-17 14:33:51 +0200 |
| commit | 5ccdf6a88d5790382ad3da6bb908c606765754e0 (patch) | |
| tree | 739ebd8e7d55a9fbc9792a62fd96166be38f5878 /runtime/lua/vim/filetype | |
| parent | eb9b93b5e025386ec9431c9d35a4a073d6946d1d (diff) | |
| download | rneovim-5ccdf6a88d5790382ad3da6bb908c606765754e0.tar.gz rneovim-5ccdf6a88d5790382ad3da6bb908c606765754e0.tar.bz2 rneovim-5ccdf6a88d5790382ad3da6bb908c606765754e0.zip | |
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)
https://github.com/vim/vim/commit/fa49eb482729a5fe7da9c9a5ed8d14f68afa55c7
Diffstat (limited to 'runtime/lua/vim/filetype')
| -rw-r--r-- | runtime/lua/vim/filetype/detect.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index 8331920406..8c10517687 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -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 |