1
0
forked from aniani/vim

patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>

Problem:    One character cmdline abbreviation not triggered after '<,'>.
Solution:   Skip over the special range. (Christian Brabandt, closes #2320)
This commit is contained in:
Bram Moolenaar
2018-05-13 18:36:27 +02:00
parent 25782a7ff4
commit 5e3423d192
3 changed files with 34 additions and 1 deletions

View File

@@ -214,3 +214,19 @@ func Test_abbreviation_CR()
delfunc Eatchar
bw!
endfunc
func Test_cabbr_visual_mode()
cabbr s su
call feedkeys(":s \<c-B>\"\<CR>", 'itx')
call assert_equal('"su ', getreg(':'))
call feedkeys(":'<,'>s \<c-B>\"\<CR>", 'itx')
let expected = '"'. "'<,'>su "
call assert_equal(expected, getreg(':'))
call feedkeys(": '<,'>s \<c-B>\"\<CR>", 'itx')
let expected = '" '. "'<,'>su "
call assert_equal(expected, getreg(':'))
call feedkeys(":'a,'bs \<c-B>\"\<CR>", 'itx')
let expected = '"'. "'a,'bsu "
call assert_equal(expected, getreg(':'))
cunabbr s
endfunc