Mercurial > vim
changeset 26688:4b8d0a62f78b v8.2.3873
patch 8.2.3873: go.mod files are not recognized
Commit: https://github.com/vim/vim/commit/82b3b4c6cf2973fe767f8e2311482af0bd95267e
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Dec 22 19:19:08 2021 +0000
patch 8.2.3873: go.mod files are not recognized
Problem: go.mod files are not recognized.
Solution: Check for the file name. (closes https://github.com/vim/vim/issues/9380)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 22 Dec 2021 20:30:04 +0100 |
parents | c997d581cf03 |
children | c5a5e166dba8 |
files | runtime/filetype.vim src/testdir/test_filetype.vim src/version.c |
diffstat | 3 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 |
--- 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'],