diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2021-12-25 15:17:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-25 15:17:55 +0100 |
commit | 4f952249072851677b88740fc2e457b08bf24f59 (patch) | |
tree | 5a108063aa54bf53c3137310c89541188bfafe6a | |
parent | 3e81c1f9b5e37a3e62dfbf2938331993de064231 (diff) | |
download | rneovim-4f952249072851677b88740fc2e457b08bf24f59.tar.gz rneovim-4f952249072851677b88740fc2e457b08bf24f59.tar.bz2 rneovim-4f952249072851677b88740fc2e457b08bf24f59.zip |
vim-patch:8.2.3873: go.mod files are not recognized (#16757)
Problem: go.mod files are not recognized.
Solution: Check for the file name. (closes vim/vim#9380)
https://github.com/vim/vim/commit/82b3b4c6cf2973fe767f8e2311482af0bd95267e
-rw-r--r-- | runtime/filetype.vim | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_filetype.vim | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 57aaeab766..8a705abd1c 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1087,7 +1087,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/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index dbe0cd8388..dba7226119 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/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'], |