summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-22 19:19:08 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-22 19:19:08 +0000
commit82b3b4c6cf2973fe767f8e2311482af0bd95267e (patch)
tree5a66a7fa1006c49ca4590044a475696abf308c00
parent080182216e605df3428cc699b9fd7e761368d12f (diff)
downloadvim-git-82b3b4c6cf2973fe767f8e2311482af0bd95267e.tar.gz
patch 8.2.3873: go.mod files are not recognizedv8.2.3873
Problem: go.mod files are not recognized. Solution: Check for the file name. (closes #9380)
-rw-r--r--runtime/filetype.vim4
-rw-r--r--src/testdir/test_filetype.vim1
-rw-r--r--src/version.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 7740d8faa..bd1d2e905 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1091,7 +1091,9 @@ au BufNewFile,BufRead *.mmp setf mmp
" Modsim III (or LambdaProlog)
au BufNewFile,BufRead *.mod
- \ if getline(1) =~ '\<module\>' |
+ \ if expand("<afile>") =~ '\<go.mod$' |
+ \ setf gomod |
+ \ elseif getline(1) =~ '\<module\>' |
\ setf lprolog |
\ else |
\ setf modsim3 |
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index cd82e3814..719d690e8 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -204,6 +204,7 @@ let s:filename_checks = {
\ 'gnash': ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'],
\ 'gnuplot': ['file.gpi'],
\ 'go': ['file.go'],
+ \ 'gomod': ['go.mod'],
\ 'gp': ['file.gp', '.gprc'],
\ 'gpg': ['/.gnupg/options', '/.gnupg/gpg.conf', '/usr/any/gnupg/options.skel', 'any/.gnupg/gpg.conf', 'any/.gnupg/options', 'any/usr/any/gnupg/options.skel'],
\ 'grads': ['file.gs'],
diff --git a/src/version.c b/src/version.c
index 7a1fd69ed..53d3b57e1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3873,
+/**/
3872,
/**/
3871,