Patch 9.0.1315
Problem:    Escaping for completion of map command not properly tested.
Solution:   Add a few test cases. (closes #12009)
Files:      src/testdir/test_cmdline.vim, src/testdir/test_cpoptions.vim


*** ../vim-9.0.1314/src/testdir/test_cmdline.vim        2023-02-05 
18:00:38.353400148 +0000
--- src/testdir/test_cmdline.vim        2023-02-17 16:35:45.855474196 +0000
***************
*** 327,343 ****
    call assert_equal('"map <Left>', getreg(':'))
    call feedkeys(":map <A-Left>\<Tab>\<Home>\"\<CR>", 'xt')
    call assert_equal("\"map <A-Left>\<Tab>", getreg(':'))
    unmap ,f
    unmap ,g
    unmap <Left>
    unmap <A-Left>x
  
!   set cpo-=< cpo-=B cpo-=k
    map <Left> left
    call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
    call assert_equal('"map <Left>', getreg(':'))
    call feedkeys(":map <M\<Tab>\<Home>\"\<CR>", 'xt')
    call assert_equal("\"map <M\<Tab>", getreg(':'))
    unmap <Left>
  
    set cpo+=<
--- 327,347 ----
    call assert_equal('"map <Left>', getreg(':'))
    call feedkeys(":map <A-Left>\<Tab>\<Home>\"\<CR>", 'xt')
    call assert_equal("\"map <A-Left>\<Tab>", getreg(':'))
+   call feedkeys(":map <M-Left>\<Tab>\<Home>\"\<CR>", 'xt')
+   call assert_equal("\"map <M-Left>x", getreg(':'))
    unmap ,f
    unmap ,g
    unmap <Left>
    unmap <A-Left>x
  
!   set cpo-=< cpo-=k
    map <Left> left
    call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
    call assert_equal('"map <Left>', getreg(':'))
    call feedkeys(":map <M\<Tab>\<Home>\"\<CR>", 'xt')
    call assert_equal("\"map <M\<Tab>", getreg(':'))
+   call feedkeys(":map \<C-V>\<C-V><M\<Tab>\<Home>\"\<CR>", 'xt')
+   call assert_equal("\"map \<C-V><Middle>x", getreg(':'))
    unmap <Left>
  
    set cpo+=<
*** ../vim-9.0.1314/src/testdir/test_cpoptions.vim      2022-10-13 
12:29:34.233533860 +0100
--- src/testdir/test_cpoptions.vim      2023-02-17 16:38:35.155643494 +0000
***************
*** 67,81 ****
--- 67,86 ----
  func Test_cpo_B()
    let save_cpo = &cpo
    new
+   imap <buffer> x<Bslash>k Test
    set cpo-=B
    iabbr <buffer> abc ab\<BS>d
    exe "normal iabc "
    call assert_equal('ab<BS>d ', getline(1))
+   call feedkeys(":imap <buffer> x\<C-A>\<C-B>\"\<CR>", 'tx')
+   call assert_equal('"imap <buffer> x\\k', @:)
    %d
    set cpo+=B
    iabbr <buffer> abc ab\<BS>d
    exe "normal iabc "
    call assert_equal('abd ', getline(1))
+   call feedkeys(":imap <buffer> x\<C-A>\<C-B>\"\<CR>", 'tx')
+   call assert_equal('"imap <buffer> x\k', @:)
    close!
    let &cpo = save_cpo
  endfunc
***************
*** 192,198 ****
    set cpo+=f
    read test_cpoptions.vim
    call assert_equal('test_cpoptions.vim', @%)
!   close!
    let &cpo = save_cpo
  endfunc
  
--- 197,204 ----
    set cpo+=f
    read test_cpoptions.vim
    call assert_equal('test_cpoptions.vim', @%)
! 
!   bwipe!
    let &cpo = save_cpo
  endfunc
  
***************
*** 438,444 ****
    set cpo+=P
    write >> XfileCpoP
    call assert_equal('XfileCpoP', @%)
!   close!
    let &cpo = save_cpo
  endfunc
  
--- 444,451 ----
    set cpo+=P
    write >> XfileCpoP
    call assert_equal('XfileCpoP', @%)
! 
!   bwipe!
    let &cpo = save_cpo
  endfunc
  
*** ../vim-9.0.1314/src/version.c       2023-02-16 15:03:08.505667449 +0000
--- src/version.c       2023-02-17 16:39:08.279676304 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1315,
  /**/

-- 
In a world without fences, who needs Gates and Windows?

 /// 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/20230217164050.5FE4A1C0440%40moolenaar.net.

Raspunde prin e-mail lui