patch 9.0.1591: some "gomod" files are not recognized

Problem:    Some "gomod" files are not recognized.
Solution:   Check for "go.mod" file name before checking out the contents.
            (Omar El Halabi, closes #12462)
This commit is contained in:
Omar El Halabi
2023-05-29 19:59:45 +01:00
committed by Bram Moolenaar
parent 247caa378f
commit c9fbd2560f
3 changed files with 10 additions and 2 deletions

View File

@ -484,14 +484,14 @@ enddef
export def FTmod()
if exists("g:filetype_mod")
exe "setf " .. g:filetype_mod
elseif expand("<afile>") =~ '\<go.mod$'
setf gomod
elseif IsLProlog()
setf lprolog
elseif getline(nextnonblank(1)) =~ '\%(\<MODULE\s\+\w\+\s*;\|^\s*(\*\)'
setf modula2
elseif IsRapid()
setf rapid
elseif expand("<afile>") =~ '\<go.mod$'
setf gomod
else
# Nothing recognized, assume modsim3
setf modsim3