Patch 8.2.5172
Problem:    "make menu" still uses legacy script.
Solution:   make menu generation script use Vim9 script, fix errors.
Files:      runtime/makemenu.vim


*** ../vim-8.2.5171/runtime/makemenu.vim        2019-12-07 18:20:54.000000000 
+0000
--- runtime/makemenu.vim        2022-06-27 23:07:48.965601417 +0100
***************
*** 1,52 ****
! " Script to define the syntax menu in synmenu.vim
! " Maintainer: Bram Moolenaar <[email protected]>
! " Last Change:        2019 Dec 07
  
! " This is used by "make menu" in the src directory.
  edit <sfile>:p:h/synmenu.vim
  
! /The Start Of The Syntax Menu/+1,/The End Of The Syntax Menu/-1d
! let s:lnum = line(".") - 1
! call append(s:lnum, "")
! let s:lnum = s:lnum + 1
! 
! " Use the SynMenu command and function to define all menu entries
! command! -nargs=* SynMenu call <SID>Syn(<q-args>)
! 
! let s:cur_menu_name = ""
! let s:cur_menu_nr = 0
! let s:cur_menu_item = 0
! let s:cur_menu_char = ""
! 
! fun! <SID>Syn(arg)
!   " isolate menu name: until the first dot
!   let i = match(a:arg, '\.')
!   let menu_name = strpart(a:arg, 0, i)
!   let r = strpart(a:arg, i + 1, 999)
!   " isolate submenu name: until the colon
!   let i = match(r, ":")
!   let submenu_name = strpart(r, 0, i)
!   " after the colon is the syntax name
!   let syntax_name = strpart(r, i + 1, 999)
! 
!   if s:cur_menu_name != menu_name
!     let s:cur_menu_name = menu_name
!     let s:cur_menu_nr = s:cur_menu_nr + 10
!     let s:cur_menu_item = 100
!     let s:cur_menu_char = submenu_name[0]
    else
!     " When starting a new letter, insert a menu separator.
!     let c = submenu_name[0]
!     if c != s:cur_menu_char
!       exe 'an 50.' . s:cur_menu_nr . '.' . s:cur_menu_item . ' &Syntax.' . 
menu_name . ".-" . c . '- <nul>'
!       let s:cur_menu_item = s:cur_menu_item + 10
!       let s:cur_menu_char = c
      endif
    endif
!   call append(s:lnum, 'an 50.' . s:cur_menu_nr . '.' . s:cur_menu_item . ' 
&Syntax.' . menu_name . "." . submenu_name . ' :cal SetSyn("' . syntax_name . 
'")<CR>')
!   let s:cur_menu_item = s:cur_menu_item + 10
!   let s:lnum = s:lnum + 1
! endfun
  
  SynMenu AB.A2ps\ config:a2ps
  SynMenu AB.Aap:aap
--- 1,54 ----
! vim9script
  
! # Script to define the syntax menu in synmenu.vim
! # Maintainer: Bram Moolenaar <[email protected]>
! # Last Change:        2022 Jun 27
! 
! # This is used by "make menu" in the src directory.
  edit <sfile>:p:h/synmenu.vim
  
! :/The Start Of The Syntax Menu/+1,/The End Of The Syntax Menu/-1d
! var lnum = line(".") - 1
! call append(lnum, "")
! lnum += 1
! 
! # Use the SynMenu command and function to define all menu entries
! command! -nargs=* SynMenu call Syn(<q-args>)
! 
! var cur_menu_name = ""
! var cur_menu_nr = 0
! var cur_menu_item = 0
! var cur_menu_char = ""
! 
! def Syn(arg: string)
!   # isolate menu name: until the first dot
!   var i = match(arg, '\.')
!   var menu_name = strpart(arg, 0, i)
!   var r = strpart(arg, i + 1, 999)
!   # isolate submenu name: until the colon
!   i = match(r, ":")
!   var submenu_name = strpart(r, 0, i)
!   # after the colon is the syntax name
!   var syntax_name = strpart(r, i + 1, 999)
! 
!   if cur_menu_name != menu_name
!     cur_menu_name = menu_name
!     cur_menu_nr += 10
!     cur_menu_item = 100
!     cur_menu_char = submenu_name[0]
    else
!     # When starting a new letter, insert a menu separator.
!     var c = submenu_name[0]
!     if c != cur_menu_char
!       exe 'an 50.' .. cur_menu_nr .. '.' .. cur_menu_item .. ' &Syntax.' .. 
menu_name .. ".-" .. c .. '- <nul>'
!       cur_menu_item += 10
!       cur_menu_char = c
      endif
    endif
!   append(lnum, 'an 50.' .. cur_menu_nr .. '.' .. cur_menu_item .. ' &Syntax.' 
.. menu_name .. "." .. submenu_name .. ' :cal SetSyn("' .. syntax_name .. 
'")<CR>')
!   cur_menu_item += 10
!   lnum += 1
! enddef
  
  SynMenu AB.A2ps\ config:a2ps
  SynMenu AB.Aap:aap
***************
*** 481,486 ****
--- 483,489 ----
  SynMenu R.Readline\ config:readline
  SynMenu R.Rebol:rebol
  SynMenu R.ReDIF:redif
+ SynMenu R.Rego:rego
  SynMenu R.Relax\ NG:rng
  SynMenu R.Remind:remind
  SynMenu R.Relax\ NG\ compact:rnc
***************
*** 675,680 ****
  SynMenu WXYZ.Yacc:yacc
  SynMenu WXYZ.Zimbu:zimbu
  
! call append(s:lnum, "")
  
  wq
--- 678,683 ----
  SynMenu WXYZ.Yacc:yacc
  SynMenu WXYZ.Zimbu:zimbu
  
! append(lnum, "")
  
  wq
*** ../vim-8.2.5171/src/version.c       2022-06-27 22:52:38.656122513 +0100
--- src/version.c       2022-06-27 23:10:08.985277193 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     5172,
  /**/

-- 
When a fly lands on the ceiling, does it do a half roll or
a half loop?

 /// 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/20220627221327.CC70A1C0842%40moolenaar.net.

Raspunde prin e-mail lui