mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9918120: runtime(filetype): Improve Verilog detection by checking for modules definition
While at it, also increase the maximum number of lines to check to 500.
fixes: vim/vim#16513
99181205c5
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
e3e1c1e765
commit
974a3f7a43
@ -1763,7 +1763,7 @@ function M.v(_, bufnr)
|
|||||||
return vim.g.filetype_v
|
return vim.g.filetype_v
|
||||||
end
|
end
|
||||||
local in_comment = 0
|
local in_comment = 0
|
||||||
for _, line in ipairs(getlines(bufnr, 1, 200)) do
|
for _, line in ipairs(getlines(bufnr, 1, 500)) do
|
||||||
if line:find('^%s*/%*') then
|
if line:find('^%s*/%*') then
|
||||||
in_comment = 1
|
in_comment = 1
|
||||||
end
|
end
|
||||||
@ -1777,7 +1777,7 @@ function M.v(_, bufnr)
|
|||||||
or line:find('%(%*') and not line:find('/[/*].*%(%*')
|
or line:find('%(%*') and not line:find('/[/*].*%(%*')
|
||||||
then
|
then
|
||||||
return 'coq'
|
return 'coq'
|
||||||
elseif findany(line, { ';%s*$', ';%s*/[/*]' }) then
|
elseif findany(line, { ';%s*$', ';%s*/[/*]', '^%s*module' }) then
|
||||||
return 'verilog'
|
return 'verilog'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user