fix: file pattern match

This commit is contained in:
Matthew Leong 2023-10-18 19:53:34 -07:00
parent 745c028e35
commit 48ee862b35

View file

@ -41,7 +41,7 @@ function M.on_attach(client, bufnr)
-- autocommand for format on save with specified filetype(s) -- autocommand for format on save with specified filetype(s)
vim.api.nvim_create_autocmd('BufWritePre', { vim.api.nvim_create_autocmd('BufWritePre', {
callback = function(ev) callback = function(ev)
for pattern, _ in pairs(filetype_patterns) do for _, pattern in pairs(filetype_patterns) do
if string.match(ev.file, pattern) then if string.match(ev.file, pattern) then
filetype_allowed = true filetype_allowed = true
end end