Skip to content
Browse files

Add a more rule to undo the last inserted ""

  • Loading branch information...
1 parent e3d6948 commit 9e930f5beeec88cc469fc3d441078c014d261689 @kana committed Mar 8, 2012
Showing with 10 additions and 2 deletions.
  1. +1 −0 autoload/smartpunc.vim
  2. +9 −2 t/api.vim
View
1 autoload/smartpunc.vim
@@ -103,6 +103,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('``', [
View
11 t/api.vim
@@ -553,12 +553,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],
+ \ ],
\ '''''': [
\ ["'", [''''''], 1, 2 - 1],
\ ["'", [''''''], 1, 3 - 1],
@@ -775,7 +781,8 @@ describe 'The default configuration'
\ '"" escape',
\ '"" leave #1',
\ '"" leave #2',
- \ '"" undo',
+ \ '"" undo #1',
+ \ '"" undo #2',
\ '`` complete',
\ '`` escape',
\ '`` leave #1',

0 comments on commit 9e930f5

Please sign in to comment.
Something went wrong with that request. Please try again.