Permalink
Browse files

Add a rule to complete """ block

  • Loading branch information...
1 parent 763e62d commit 2f46a1ede87cc0fb54f5c78d3879125f07d8552a @kana committed Mar 29, 2012
Showing with 10 additions and 0 deletions.
  1. +4 −0 autoload/smartinput.vim
  2. +6 −0 t/api.vim
View
@@ -108,6 +108,9 @@ function! smartinput#define_default_rules() "{{{2
\ {'at': '""\%#', 'char': '<BS>', 'input': '<BS><BS>'},
\ {'at': '\\\%#', 'char': '"', 'input': '"'},
\ ])
+ call urules.add('"""', [
+ \ {'at': '""\%#', 'char': '"', 'input': '""""<Left><Left><Left>'},
+ \ ])
call urules.add('``', [
\ {'at': '\%#', 'char': '`', 'input': '``<Left>'},
\ {'at': '\%#`', 'char': '`', 'input': '<Right>'},
@@ -133,6 +136,7 @@ function! smartinput#define_default_rules() "{{{2
\ urules.table['{}'],
\ urules.table[''''''],
\ urules.table['""'],
+ \ urules.table['"""'],
\ urules.table['``'],
\ urules.table['English'],
\ ],
View
@@ -565,6 +565,11 @@ describe 'The default configuration'
\ ["\"", ['x""'], 1, 4 - 1],
\ ["\<BS>", ['x'], 1, 2 - 1],
\ ],
+ \ '""" complete': [
+ \ ["\"", ['""'], 1, 2 - 1],
+ \ ["\"", ['""'], 1, 3 - 1],
+ \ ["\"", ['""""""'], 1, 4 - 1],
+ \ ],
\ '''''': [
\ ["'", [''''''], 1, 2 - 1],
\ ["'", [''''''], 1, 3 - 1],
@@ -789,6 +794,7 @@ describe 'The default configuration'
\ '"" leave #2',
\ '"" undo #1',
\ '"" undo #2',
+ \ '""" complete',
\ '`` complete',
\ '`` escape',
\ '`` leave #1',

0 comments on commit 2f46a1e

Please sign in to comment.