Use Strings instead of Tables in vim.filetype.matchregex Doc (#19604)

docs: use strings instead of tables in vim.filetype.matchregex doc
This commit is contained in:
LaurenceWarne 2022-08-01 13:45:43 +01:00 committed by GitHub
parent ece0850b73
commit 9f5d5aa3da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -2087,9 +2087,9 @@ add({filetypes}) *vim.filetype.add()*
priority = -math.huge, priority = -math.huge,
function(path, bufnr) function(path, bufnr)
local content = vim.filetype.getlines(bufnr, 1) local content = vim.filetype.getlines(bufnr, 1)
if vim.filetype.matchregex(content, { [[^#!.*\<mine\>]] }) then if vim.filetype.matchregex(content, [[^#!.*\<mine\>]]) then
return 'mine' return 'mine'
elseif vim.filetype.matchregex(content, { [[\<drawing\>]] }) then elseif vim.filetype.matchregex(content, [[\<drawing\>]]) then
return 'drawing' return 'drawing'
end end
end, end,

View File

@ -2275,9 +2275,9 @@ end
--- priority = -math.huge, --- priority = -math.huge,
--- function(path, bufnr) --- function(path, bufnr)
--- local content = vim.filetype.getlines(bufnr, 1) --- local content = vim.filetype.getlines(bufnr, 1)
--- if vim.filetype.matchregex(content, { [[^#!.*\\<mine\\>]] }) then --- if vim.filetype.matchregex(content, [[^#!.*\\<mine\\>]]) then
--- return 'mine' --- return 'mine'
--- elseif vim.filetype.matchregex(content, { [[\\<drawing\\>]] }) then --- elseif vim.filetype.matchregex(content, [[\\<drawing\\>]]) then
--- return 'drawing' --- return 'drawing'
--- end --- end
--- end, --- end,