mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 9.0.1315: escaping for completion of map command not properly tested
Problem: Escaping for completion of map command not properly tested. Solution: Add a few test cases. (closes #12009)
This commit is contained in:
parent
1d87e11a1e
commit
c3a26c6bff
@ -327,17 +327,21 @@ func Test_map_completion()
|
|||||||
call assert_equal('"map <Left>', getreg(':'))
|
call assert_equal('"map <Left>', getreg(':'))
|
||||||
call feedkeys(":map <A-Left>\<Tab>\<Home>\"\<CR>", 'xt')
|
call feedkeys(":map <A-Left>\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
call assert_equal("\"map <A-Left>\<Tab>", getreg(':'))
|
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 ,f
|
||||||
unmap ,g
|
unmap ,g
|
||||||
unmap <Left>
|
unmap <Left>
|
||||||
unmap <A-Left>x
|
unmap <A-Left>x
|
||||||
|
|
||||||
set cpo-=< cpo-=B cpo-=k
|
set cpo-=< cpo-=k
|
||||||
map <Left> left
|
map <Left> left
|
||||||
call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
|
call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
call assert_equal('"map <Left>', getreg(':'))
|
call assert_equal('"map <Left>', getreg(':'))
|
||||||
call feedkeys(":map <M\<Tab>\<Home>\"\<CR>", 'xt')
|
call feedkeys(":map <M\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
call assert_equal("\"map <M\<Tab>", getreg(':'))
|
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>
|
unmap <Left>
|
||||||
|
|
||||||
set cpo+=<
|
set cpo+=<
|
||||||
|
@ -67,15 +67,20 @@ endfunc
|
|||||||
func Test_cpo_B()
|
func Test_cpo_B()
|
||||||
let save_cpo = &cpo
|
let save_cpo = &cpo
|
||||||
new
|
new
|
||||||
|
imap <buffer> x<Bslash>k Test
|
||||||
set cpo-=B
|
set cpo-=B
|
||||||
iabbr <buffer> abc ab\<BS>d
|
iabbr <buffer> abc ab\<BS>d
|
||||||
exe "normal iabc "
|
exe "normal iabc "
|
||||||
call assert_equal('ab<BS>d ', getline(1))
|
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
|
%d
|
||||||
set cpo+=B
|
set cpo+=B
|
||||||
iabbr <buffer> abc ab\<BS>d
|
iabbr <buffer> abc ab\<BS>d
|
||||||
exe "normal iabc "
|
exe "normal iabc "
|
||||||
call assert_equal('abd ', getline(1))
|
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!
|
close!
|
||||||
let &cpo = save_cpo
|
let &cpo = save_cpo
|
||||||
endfunc
|
endfunc
|
||||||
@ -192,7 +197,8 @@ func Test_cpo_f()
|
|||||||
set cpo+=f
|
set cpo+=f
|
||||||
read test_cpoptions.vim
|
read test_cpoptions.vim
|
||||||
call assert_equal('test_cpoptions.vim', @%)
|
call assert_equal('test_cpoptions.vim', @%)
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
let &cpo = save_cpo
|
let &cpo = save_cpo
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -438,7 +444,8 @@ func Test_cpo_P()
|
|||||||
set cpo+=P
|
set cpo+=P
|
||||||
write >> XfileCpoP
|
write >> XfileCpoP
|
||||||
call assert_equal('XfileCpoP', @%)
|
call assert_equal('XfileCpoP', @%)
|
||||||
close!
|
|
||||||
|
bwipe!
|
||||||
let &cpo = save_cpo
|
let &cpo = save_cpo
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1315,
|
||||||
/**/
|
/**/
|
||||||
1314,
|
1314,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user