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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230529190021.CB6B31C1514%40moolenaar.net.

Raspunde prin e-mail lui