Permalink
Browse files

Add a rule to complete ''' block

  • Loading branch information...
1 parent 361c56e commit ac41ad85ebfe2b0c94fcc48ef0368a04e99cd932 @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
@@ -101,6 +101,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>'},
@@ -144,6 +147,7 @@ function! smartinput#define_default_rules() "{{{2
\ urules.table['[]'],
\ urules.table['{}'],
\ urules.table[''''''],
+ \ urules.table[''''''''],
\ urules.table['""'],
\ urules.table['"""'],
\ urules.table['``'],
View
@@ -639,6 +639,11 @@ describe 'The default configuration'
\ ["\<C-v>'", ['x'''''], 1, 4 - 1],
\ ["\<BS>", ['x'], 1, 2 - 1],
\ ],
+ \ ''''''' complete': [
+ \ ["'", [''''''], 1, 2 - 1],
+ \ ["'", [''''''], 1, 3 - 1],
+ \ ["'", [''''''''''''''], 1, 4 - 1],
+ \ ],
\ '() complete': [
\ ["(", ['()'], 1, 2 - 1],
\ ],
@@ -851,6 +856,7 @@ describe 'The default configuration'
\ ''''' leave #2',
\ ''''' undo #1',
\ ''''' undo #2',
+ \ ''''''' complete',
\ '"" complete',
\ '"" escape',
\ '"" leave #1',

0 comments on commit ac41ad8

Please sign in to comment.