Patch 9.0.1591

8 views
Skip to first unread message

Bram Moolenaar

unread,
May 29, 2023, 3:00:26 PM5/29/23
to vim...@googlegroups.com

Patch 9.0.1591
Problem: Some "gomod" files are not recognized.
Solution: Check for "go.mod" file name before checking out the contents.
(Omar El Halabi, closes #12462)
Files: runtime/autoload/dist/ft.vim, src/testdir/test_filetype.vim


*** ../vim-9.0.1590/runtime/autoload/dist/ft.vim 2023-05-10 22:01:51.308844691 +0100
--- runtime/autoload/dist/ft.vim 2023-05-29 19:58:24.125989207 +0100
***************
*** 484,497 ****
export def FTmod()
if exists("g:filetype_mod")
exe "setf " .. g:filetype_mod
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
--- 484,497 ----
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
else
# Nothing recognized, assume modsim3
setf modsim3
*** ../vim-9.0.1590/src/testdir/test_filetype.vim 2023-05-29 17:37:10.016264854 +0100
--- src/testdir/test_filetype.vim 2023-05-29 19:57:32.002120998 +0100
***************
*** 1534,1539 ****
--- 1534,1545 ----
bwipe!
call delete('go.mod')

+ call writefile(['module M'], 'go.mod')
+ split go.mod
+ call assert_equal('gomod', &filetype)
+ bwipe!
+ call delete('go.mod')
+
filetype off
endfunc

*** ../vim-9.0.1590/src/version.c 2023-05-29 17:37:10.020264849 +0100
--- src/version.c 2023-05-29 19:56:43.054246852 +0100
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1591,
/**/

--
From "know your smileys":
*<|:-) Santa Claus (Ho Ho Ho)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages