Permalink
Browse files

Add a more rule to undo the last inserted ''

  • Loading branch information...
1 parent 579e9f9 commit e3d69487ecb3075c5d107dae531d777df63cd2f6 @kana committed Mar 7, 2012
Showing with 10 additions and 2 deletions.
  1. +1 −0 autoload/smartpunc.vim
  2. +9 −2 t/api.vim
View
@@ -96,6 +96,7 @@ function! smartpunc#define_default_rules() "{{{2
\ {'at': '\%#', 'char': '''', 'input': '''''<Left>'},
\ {'at': '\%#''\ze', 'char': '''', 'input': '<Right>'},
\ {'at': '''\%#''', 'char': '<BS>', 'input': '<BS><Del>'},
+ \ {'at': '''''\%#', 'char': '<BS>', 'input': '<BS><BS>'},
\ {'at': '\\\%#', 'char': '''', 'input': ''''},
\ ])
call urules.add('""', [
View
@@ -587,12 +587,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],
+ \ ["\<C-v>'", ['x'''], 1, 3 - 1],
+ \ ["\<C-v>'", ['x'''''], 1, 4 - 1],
+ \ ["\<BS>", ['x'], 1, 2 - 1],
+ \ ],
\ '() complete': [
\ ["(", ['()'], 1, 2 - 1],
\ ],
@@ -763,7 +769,8 @@ describe 'The default configuration'
\ ''''' escape',
\ ''''' leave #1',
\ ''''' leave #2',
- \ ''''' undo',
+ \ ''''' undo #1',
+ \ ''''' undo #2',
\ '"" complete',
\ '"" escape',
\ '"" leave #1',

0 comments on commit e3d6948

Please sign in to comment.