Permalink
Browse files

Add rules to leave from """ block

  • Loading branch information...
1 parent 9e0e66f commit d9784f53704c1e208e71166b6a401b819dc571c9 @kana committed Mar 29, 2012
Showing with 16 additions and 0 deletions.
  1. +1 −0 autoload/smartinput.vim
  2. +15 −0 t/api.vim
View
@@ -110,6 +110,7 @@ function! smartinput#define_default_rules() "{{{2
\ ])
call urules.add('"""', [
\ {'at': '""\%#', 'char': '"', 'input': '""""<Left><Left><Left>'},
+ \ {'at': '\%#"""', 'char': '"', 'input': '<Right><Right><Right>'},
\ {'at': '"""\%#"""', 'char': '<BS>', 'input': '<BS><BS><BS><Del><Del><Del>'},
\ {'at': '""""""\%#', 'char': '<BS>', 'input': '<BS><BS><BS><BS><BS><BS>'},
\ ])
View
@@ -570,6 +570,19 @@ describe 'The default configuration'
\ ["\"", ['""'], 1, 3 - 1],
\ ["\"", ['""""""'], 1, 4 - 1],
\ ],
+ \ '""" leave #1': [
+ \ ["\"", ['""'], 1, 2 - 1],
+ \ ["\"", ['""'], 1, 3 - 1],
+ \ ["\"", ['""""""'], 1, 4 - 1],
+ \ ["\"", ['""""""'], 1, 7 - 1],
+ \ ],
+ \ '""" leave #2': [
+ \ ["\"", ['""'], 1, 2 - 1],
+ \ ["\"", ['""'], 1, 3 - 1],
+ \ ["\"", ['""""""'], 1, 4 - 1],
+ \ ["x", ['"""x"""'], 1, 5 - 1],
+ \ ["\"", ['"""x"""'], 1, 8 - 1],
+ \ ],
\ '""" undo #1': [
\ ["\"", ['""'], 1, 2 - 1],
\ ["\"", ['""'], 1, 3 - 1],
@@ -811,6 +824,8 @@ describe 'The default configuration'
\ '"" undo #1',
\ '"" undo #2',
\ '""" complete',
+ \ '""" leave #1',
+ \ '""" leave #2',
\ '""" undo #1',
\ '""" undo #2',
\ '`` complete',

0 comments on commit d9784f5

Please sign in to comment.