Patch 8.2.0478
Problem:    New buffers are not added to the Buffers menu.
Solution:   Turn number into string. (Yee Cheng Chin, closes #5864)
Files:      runtime/menu.vim, src/testdir/test_menu.vim


*** ../vim-8.2.0477/runtime/menu.vim    2020-03-19 18:46:53.956641477 +0100
--- runtime/menu.vim    2020-03-29 20:03:33.809372453 +0200
***************
*** 2,8 ****
  " You can also use this as a start for your own set of menus.
  "
  " Maintainer: Bram Moolenaar <[email protected]>
! " Last Change:        2020 Mar 19
  
  " Note that ":an" (short for ":anoremenu") is often used to make a menu work
  " in all modes and avoid side effects from mappings defined by the user.
--- 2,8 ----
  " You can also use this as a start for your own set of menus.
  "
  " Maintainer: Bram Moolenaar <[email protected]>
! " Last Change:        2020 Mar 29
  
  " Note that ":an" (short for ":anoremenu") is often used to make a menu work
  " in all modes and avoid side effects from mappings defined by the user.
***************
*** 672,678 ****
        call s:BMShow()
      else
        let name = expand("<afile>")
!       let num = expand("<abuf>")
        if s:BMCanAdd(name, num)
        call <SID>BMFilename(name, num)
        let s:bmenu_count += 1
--- 672,678 ----
        call s:BMShow()
      else
        let name = expand("<afile>")
!       let num = expand("<abuf>") + 0 " add zero to convert to a number type
        if s:BMCanAdd(name, num)
        call <SID>BMFilename(name, num)
        let s:bmenu_count += 1
*** ../vim-8.2.0477/src/testdir/test_menu.vim   2020-03-19 18:46:53.960641454 
+0100
--- src/testdir/test_menu.vim   2020-03-29 20:01:21.473815859 +0200
***************
*** 33,42 ****
  
    let orig_buffer_menus = execute("nmenu Buffers")
  
    " Make a new command-line window, test that it does not create a new buffer
    " menu.
    call feedkeys("q::let cmdline_buffer_menus=execute('nmenu 
Buffers')\<CR>:q\<CR>", 'ntx')
!   call assert_equal(len(split(orig_buffer_menus, "\n")), 
len(split(cmdline_buffer_menus, "\n")))
    call assert_equal(orig_buffer_menus, execute("nmenu Buffers"))
  
    if has('terminal')
--- 33,49 ----
  
    let orig_buffer_menus = execute("nmenu Buffers")
  
+   " Test that regular new buffer results in a new buffer menu item.
+   new
+   let new_buffer_menus = execute('nmenu Buffers')
+   call assert_equal(len(split(orig_buffer_menus, "\n")) + 2, 
len(split(new_buffer_menus, "\n")))
+   bwipe!
+   call assert_equal(orig_buffer_menus, execute("nmenu Buffers"))
+ 
    " Make a new command-line window, test that it does not create a new buffer
    " menu.
    call feedkeys("q::let cmdline_buffer_menus=execute('nmenu 
Buffers')\<CR>:q\<CR>", 'ntx')
!   call assert_equal(len(split(orig_buffer_menus, "\n")) + 2, 
len(split(cmdline_buffer_menus, "\n")))
    call assert_equal(orig_buffer_menus, execute("nmenu Buffers"))
  
    if has('terminal')
***************
*** 44,50 ****
      " item.
      terminal
      let term_buffer_menus = execute('nmenu Buffers')
!     call assert_equal(len(split(orig_buffer_menus, "\n")), 
len(split(term_buffer_menus, "\n")))
      bwipe!
      call assert_equal(orig_buffer_menus, execute("nmenu Buffers"))
    endif
--- 51,57 ----
      " item.
      terminal
      let term_buffer_menus = execute('nmenu Buffers')
!     call assert_equal(len(split(orig_buffer_menus, "\n")) + 2, 
len(split(term_buffer_menus, "\n")))
      bwipe!
      call assert_equal(orig_buffer_menus, execute("nmenu Buffers"))
    endif
***************
*** 155,160 ****
--- 162,170 ----
  
  " Test for menu item completion in command line
  func Test_menu_expand()
+   " Make sure we don't have stale menu items like Buffers menu.
+   source $VIMRUNTIME/delmenu.vim
+ 
    " Create the menu itmes for test
    menu Dummy.Nothing lll
    for i in range(1, 4)
*** ../vim-8.2.0477/src/version.c       2020-03-29 18:40:08.853652561 +0200
--- src/version.c       2020-03-29 20:02:44.545537476 +0200
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     478,
  /**/

-- 
Q: What's orange and sounds like a parrot?
A: A carrot

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202003291809.02TI9Elc007338%40masaka.moolenaar.net.

Raspunde prin e-mail lui