diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-17 16:40:20 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-02-17 16:40:20 +0000 |
commit | c3a26c6bff666a368b0a22d35d2e00aa62770f8c (patch) | |
tree | 2400277c548c98887d8620825c478f7d0c7f9543 | |
parent | 1d87e11a1ef201b26ed87585fba70182ad0c468a (diff) |
patch 9.0.1315: escaping for completion of map command not properly testedv9.0.1315
Problem: Escaping for completion of map command not properly tested.
Solution: Add a few test cases. (closes #12009)
-rw-r--r-- | src/testdir/test_cmdline.vim | 6 | ||||
-rw-r--r-- | src/testdir/test_cpoptions.vim | 11 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index e1c336a950..ddcb260451 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -327,17 +327,21 @@ func Test_map_completion() 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-=B cpo-=k + 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+=< diff --git a/src/testdir/test_cpoptions.vim b/src/testdir/test_cpoptions.vim index a5822aa3bc..6ff8301d63 100644 --- a/src/testdir/test_cpoptions.vim +++ b/src/testdir/test_cpoptions.vim @@ -67,15 +67,20 @@ endfunc 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,7 +197,8 @@ func Test_cpo_f() set cpo+=f read test_cpoptions.vim call assert_equal('test_cpoptions.vim', @%) - close! + + bwipe! let &cpo = save_cpo endfunc @@ -438,7 +444,8 @@ func Test_cpo_P() set cpo+=P write >> XfileCpoP call assert_equal('XfileCpoP', @%) - close! + + bwipe! let &cpo = save_cpo endfunc diff --git a/src/version.c b/src/version.c index c9a488b091..47c43e29a6 100644 --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1315, +/**/ 1314, /**/ 1313, |