mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
ece0850b73
commit
9f5d5aa3da
@ -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,
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user