aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2025-01-25 15:41:29 +0100
committerChristian Clason <ch.clason+github@icloud.com>2025-01-25 23:56:18 +0100
commit974a3f7a438bb772bd681987b25214784c52c7da (patch)
tree7b5f3db8660aa50893c9152301035bc2657042b9
parente3e1c1e76581e63ea588a553f9b91f36a61d9d51 (diff)
downloadrneovim-974a3f7a438bb772bd681987b25214784c52c7da.tar.gz
rneovim-974a3f7a438bb772bd681987b25214784c52c7da.tar.bz2
rneovim-974a3f7a438bb772bd681987b25214784c52c7da.zip
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 https://github.com/vim/vim/commit/99181205c5f8284a30f839107a12932924168f17 Co-authored-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--runtime/lua/vim/filetype/detect.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua
index 855893530e..705ce33872 100644
--- a/runtime/lua/vim/filetype/detect.lua
+++ b/runtime/lua/vim/filetype/detect.lua
@@ -1763,7 +1763,7 @@ function M.v(_, bufnr)
return vim.g.filetype_v
end
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
in_comment = 1
end
@@ -1777,7 +1777,7 @@ function M.v(_, bufnr)
or line:find('%(%*') and not line:find('/[/*].*%(%*')
then
return 'coq'
- elseif findany(line, { ';%s*$', ';%s*/[/*]' }) then
+ elseif findany(line, { ';%s*$', ';%s*/[/*]', '^%s*module' }) then
return 'verilog'
end
end