Browse files

Add rules to undo ``` completion

  • Loading branch information...
1 parent a65f73d commit d51db36db3a3d05b36b8a141498b2e83ad3dd3cb @kana committed Mar 29, 2012
Showing with 20 additions and 0 deletions.
  1. +2 −0 autoload/smartinput.vim
  2. +18 −0 t/api.vim
View
2 autoload/smartinput.vim
@@ -123,6 +123,8 @@ function! smartinput#define_default_rules() "{{{2
\ ])
call urules.add('```', [
\ {'at': '``\%#', 'char': '`', 'input': '````<Left><Left><Left>'},
+ \ {'at': '```\%#```', 'char': '<BS>', 'input': '<BS><BS><BS><Del><Del><Del>'},
+ \ {'at': '``````\%#', 'char': '<BS>', 'input': '<BS><BS><BS><BS><BS><BS>'},
\ ])
call urules.add('English', [
\ {'at': '\w\%#', 'char': '''', 'input': ''''},
View
18 t/api.vim
@@ -736,6 +736,22 @@ describe 'The default configuration'
\ ["`", ['``'], 1, 3 - 1],
\ ["`", ['``````'], 1, 4 - 1],
\ ],
+ \ '``` undo #1': [
+ \ ["`", ['``'], 1, 2 - 1],
+ \ ["`", ['``'], 1, 3 - 1],
+ \ ["`", ['``````'], 1, 4 - 1],
+ \ ["x", ['```x```'], 1, 5 - 1],
+ \ ["\<BS>", ['``````'], 1, 4 - 1],
+ \ ["\<BS>", [''], 1, 0 + 1],
+ \ ],
+ \ '``` undo #2': [
+ \ ["x", ['x'], 1, 2 - 1],
+ \ ["`", ['x``'], 1, 3 - 1],
+ \ ["`", ['x``'], 1, 4 - 1],
+ \ ["`", ['x``````'], 1, 5 - 1],
+ \ ["\<End>", ['x``````'], 1, 8 - 1],
+ \ ["\<BS>", ['x'], 1, 2 - 1],
+ \ ],
\ '{} complete': [
\ ["{", ['{}'], 1, 2 - 1],
\ ],
@@ -840,6 +856,8 @@ describe 'The default configuration'
\ '`` undo #1',
\ '`` undo #2',
\ '``` complete',
+ \ '``` undo #1',
+ \ '``` undo #2',
\ 'English',
\ ])
end

0 comments on commit d51db36

Please sign in to comment.