mirror of
https://github.com/neovim/neovim.git
synced 2026-04-25 08:44:06 +00:00
fix(filetype): make vim.filetype.match() work with contents only (#22181)
Co-authored-by: Gregory Anders <greg@gpanders.com>
This commit is contained in:
committed by
GitHub
parent
24ec0aaa7a
commit
9668c166e8
@@ -94,6 +94,14 @@ describe('vim.filetype', function()
|
||||
return vim.filetype.match({ buf = 0 })
|
||||
]])
|
||||
end)
|
||||
|
||||
it('works with contents #22180', function()
|
||||
eq('sh', exec_lua [[
|
||||
-- Needs to be set so detect#sh doesn't fail
|
||||
vim.g.ft_ignore_pat = "\\.\\(Z\\|gz\\|bz2\\|zip\\|tgz\\)$"
|
||||
return vim.filetype.match({ contents = { '#!/usr/bin/env bash' } })
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('filetype.lua', function()
|
||||
|
||||
Reference in New Issue
Block a user