diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 0e58d1b1fe..3302a00b6a 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2087,9 +2087,9 @@ add({filetypes}) *vim.filetype.add()* priority = -math.huge, function(path, bufnr) local content = vim.filetype.getlines(bufnr, 1) - if vim.filetype.matchregex(content, { [[^#!.*\]] }) then + if vim.filetype.matchregex(content, [[^#!.*\]]) then return 'mine' - elseif vim.filetype.matchregex(content, { [[\]] }) then + elseif vim.filetype.matchregex(content, [[\]]) then return 'drawing' end end, diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 9c59442caf..1b209e6a9d 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2275,9 +2275,9 @@ end --- priority = -math.huge, --- function(path, bufnr) --- local content = vim.filetype.getlines(bufnr, 1) ---- if vim.filetype.matchregex(content, { [[^#!.*\\]] }) then +--- if vim.filetype.matchregex(content, [[^#!.*\\]]) then --- return 'mine' ---- elseif vim.filetype.matchregex(content, { [[\\]] }) then +--- elseif vim.filetype.matchregex(content, [[\\]]) then --- return 'drawing' --- end --- end,