mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 10:31:48 +00:00
vim-patch:9.0.1591: some "gomod" files are not recognized (#23820)
Problem: Some "gomod" files are not recognized.
Solution: Check for "go.mod" file name before checking out the contents.
(Omar El Halabi, closes vim/vim#12462)
c9fbd2560f
This commit is contained in:
@@ -771,14 +771,14 @@ end
|
||||
function M.mod(path, bufnr)
|
||||
if vim.g.filetype_mod then
|
||||
return vim.g.filetype_mod
|
||||
elseif matchregex(path, [[\c\<go\.mod$]]) then
|
||||
return 'gomod'
|
||||
elseif is_lprolog(bufnr) then
|
||||
return 'lprolog'
|
||||
elseif matchregex(nextnonblank(bufnr, 1), [[\%(\<MODULE\s\+\w\+\s*;\|^\s*(\*\)]]) then
|
||||
return 'modula2'
|
||||
elseif is_rapid(bufnr) then
|
||||
return 'rapid'
|
||||
elseif matchregex(path, [[\c\<go\.mod$]]) then
|
||||
return 'gomod'
|
||||
else
|
||||
-- Nothing recognized, assume modsim3
|
||||
return 'modsim3'
|
||||
|
||||
Reference in New Issue
Block a user