From bee7b6167df6268a59a3ac6e5441c329ccfd8e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dundar=20G=C3=B6c?= Date: Thu, 23 Dec 2021 12:56:07 +0100 Subject: [PATCH] vim-patch:8.2.3873: go.mod files are not recognized Problem: go.mod files are not recognized. Solution: Check for the file name. (closes vim/vim#9380) https://github.com/vim/vim/commit/82b3b4c6cf2973fe767f8e2311482af0bd95267e (cherry picked from commit 2f813d6c3e55c9f731136d64a77a0d2bcf98de23) --- runtime/filetype.vim | 4 +++- src/nvim/testdir/test_filetype.vim | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index cc28dba1d0..8eab443b0c 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1080,7 +1080,9 @@ au BufNewFile,BufRead *.mmp setf mmp " Modsim III (or LambdaProlog) au BufNewFile,BufRead *.mod - \ if getline(1) =~ '\' | + \ if expand("") =~ '\' | \ setf lprolog | \ else | \ setf modsim3 | diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 48b434b9fd..7ef5113507 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'],