mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 00:18:33 +00:00
vim-patch:9.0.0088: pattern for detecting bitbake files is not sufficient (#19547)
Problem: Pattern for detecting bitbake files is not sufficient.
Solution: Adjust the pattern. (Gregory Anders, closes vim/vim#10743)
30e212dac1
This commit is contained in:
2
runtime/autoload/dist/ft.vim
vendored
2
runtime/autoload/dist/ft.vim
vendored
@@ -519,7 +519,7 @@ func dist#ft#FTinc()
|
|||||||
" headers so assume POV-Ray
|
" headers so assume POV-Ray
|
||||||
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords
|
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords
|
||||||
setf pascal
|
setf pascal
|
||||||
elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '\w\+ = '
|
elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}]*\s\+\%(??\|[?:+]\)\?= '
|
||||||
setf bitbake
|
setf bitbake
|
||||||
else
|
else
|
||||||
call dist#ft#FTasmsyntax()
|
call dist#ft#FTasmsyntax()
|
||||||
|
@@ -554,7 +554,7 @@ function M.inc(bufnr)
|
|||||||
-- headers so assume POV-Ray
|
-- headers so assume POV-Ray
|
||||||
elseif findany(lines, { '^%s{', '^%s%(%*' }) or matchregex(lines, pascal_keywords) then
|
elseif findany(lines, { '^%s{', '^%s%(%*' }) or matchregex(lines, pascal_keywords) then
|
||||||
return 'pascal'
|
return 'pascal'
|
||||||
elseif findany(lines, { '^%s*inherit ', '^%s*require ', '^%s*%w+%s+= ' }) then
|
elseif findany(lines, { '^%s*inherit ', '^%s*require ', '^%s*%u[%w_:${}]*%s+%??[?:+]?= ' }) then
|
||||||
return 'bitbake'
|
return 'bitbake'
|
||||||
else
|
else
|
||||||
local syntax = M.asm_syntax(bufnr)
|
local syntax = M.asm_syntax(bufnr)
|
||||||
|
@@ -1861,6 +1861,31 @@ func Test_inc_file()
|
|||||||
call assert_equal('bitbake', &filetype)
|
call assert_equal('bitbake', &filetype)
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
|
call writefile(['S = "${WORKDIR}"'], 'Xfile.inc')
|
||||||
|
split Xfile.inc
|
||||||
|
call assert_equal('bitbake', &filetype)
|
||||||
|
bwipe!
|
||||||
|
|
||||||
|
call writefile(['DEPENDS:append = " somedep"'], 'Xfile.inc')
|
||||||
|
split Xfile.inc
|
||||||
|
call assert_equal('bitbake', &filetype)
|
||||||
|
bwipe!
|
||||||
|
|
||||||
|
call writefile(['MACHINE ??= "qemu"'], 'Xfile.inc')
|
||||||
|
split Xfile.inc
|
||||||
|
call assert_equal('bitbake', &filetype)
|
||||||
|
bwipe!
|
||||||
|
|
||||||
|
call writefile(['PROVIDES := "test"'], 'Xfile.inc')
|
||||||
|
split Xfile.inc
|
||||||
|
call assert_equal('bitbake', &filetype)
|
||||||
|
bwipe!
|
||||||
|
|
||||||
|
call writefile(['RDEPENDS_${PN} += "bar"'], 'Xfile.inc')
|
||||||
|
split Xfile.inc
|
||||||
|
call assert_equal('bitbake', &filetype)
|
||||||
|
bwipe!
|
||||||
|
|
||||||
" asm
|
" asm
|
||||||
call writefile(['asmsyntax=bar'], 'Xfile.inc')
|
call writefile(['asmsyntax=bar'], 'Xfile.inc')
|
||||||
split Xfile.inc
|
split Xfile.inc
|
||||||
|
Reference in New Issue
Block a user