Skip to content
Browse files

Add rules to undo """ completion

  • Loading branch information...
1 parent 2f46a1e commit 9e0e66fd3060d02d8dfc7b83038f76fdbce99373 @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
@@ -110,6 +110,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('``', [
\ {'at': '\%#', 'char': '`', 'input': '``<Left>'},
View
18 t/api.vim
@@ -570,6 +570,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],
+ \ ],
\ '''''': [
\ ["'", [''''''], 1, 2 - 1],
\ ["'", [''''''], 1, 3 - 1],
@@ -795,6 +811,8 @@ describe 'The default configuration'
\ '"" undo #1',
\ '"" undo #2',
\ '""" complete',
+ \ '""" undo #1',
+ \ '""" undo #2',
\ '`` complete',
\ '`` escape',
\ '`` leave #1',

0 comments on commit 9e0e66f

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