diff src/testdir/test_mapping.vim @ 13933:bea665293ea0 v8.0.1837

patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'> commit https://github.com/vim/vim/commit/5e3423d192bfa502c6704f731fa2ec6821f9a2f0 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 13 18:36:27 2018 +0200 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 https://github.com/vim/vim/issues/2320)
author Christian Brabandt <cb@256bit.org>
date Sun, 13 May 2018 18:45:05 +0200
parents a27d380b257f
children 54457fc4af0b
line wrap: on
line diff
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -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