Permalink
Browse files

Add a more rule to undo the last inserted ``

  • Loading branch information...
kana committed Mar 7, 2012
1 parent 9e930f5 commit 982cd85b1a26568da5cedfdb590854bcc412c7b6
Showing with 10 additions and 2 deletions.
  1. +1 −0 autoload/smartpunc.vim
  2. +9 −2 t/api.vim
View
@@ -110,6 +110,7 @@ function! smartpunc#define_default_rules() "{{{2
\ {'at': '\%#', 'char': '`', 'input': '``<Left>'},
\ {'at': '\%#`', 'char': '`', 'input': '<Right>'},
\ {'at': '`\%#`', 'char': '<BS>', 'input': '<BS><Del>'},
+ \ {'at': '``\%#', 'char': '<BS>', 'input': '<BS><BS>'},
\ {'at': '\\\%#', 'char': '`', 'input': '`'},
\ ])
call urules.add('English', [
View
@@ -685,12 +685,18 @@ describe 'The default configuration'
\ ["x", ['`x`'], 1, 3 - 1],
\ ["`", ['`x`'], 1, 4 - 1],
\ ],
- \ '`` undo': [
+ \ '`` undo #1': [
\ ["`", ['``'], 1, 2 - 1],
\ ["x", ['`x`'], 1, 3 - 1],
\ ["\<BS>", ['``'], 1, 2 - 1],
\ ["\<BS>", [''], 1, 0 + 1],
\ ],
+ \ '`` undo #2': [
+ \ ["x", ['x'], 1, 2 - 1],
+ \ ["`", ['x``'], 1, 3 - 1],
+ \ ["`", ['x``'], 1, 4 - 1],
+ \ ["\<BS>", ['x'], 1, 2 - 1],
+ \ ],
\ '{} complete': [
\ ["{", ['{}'], 1, 2 - 1],
\ ],
@@ -787,7 +793,8 @@ describe 'The default configuration'
\ '`` escape',
\ '`` leave #1',
\ '`` leave #2',
- \ '`` undo',
+ \ '`` undo #1',
+ \ '`` undo #2',
\ 'English',
\ ])
end

0 comments on commit 982cd85

Please sign in to comment.