Skip to content

Commit

Permalink
Revise a rule to leave from multiline/spaced []
Browse files Browse the repository at this point in the history
  • Loading branch information
kana committed Apr 1, 2012
1 parent 2b0ea75 commit 43931fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/smartinput.vim
Expand Up @@ -81,7 +81,7 @@ function! smartinput#define_default_rules() "{{{2
\ ])
call urules.add('[]', [
\ {'at': '\%#', 'char': '[', 'input': '[]<Left>'},
\ {'at': '\%#\]', 'char': ']', 'input': '<Right>'},
\ {'at': '\%#\_s*\]', 'char': ']', 'input': '<C-o>:call search('']'', ''cW'')<Enter><Right>'},
\ {'at': '\[\%#\]', 'char': '<BS>', 'input': '<BS><Del>'},
\ {'at': '\[\]\%#', 'char': '<BS>', 'input': '<BS><BS>'},
\ {'at': '\\\%#', 'char': '[', 'input': '['},
Expand Down
12 changes: 12 additions & 0 deletions t/api.vim
Expand Up @@ -735,6 +735,16 @@ describe 'The default configuration'
\ ["x", ['[x]'], 1, 3 - 1],
\ ["]", ['[x]'], 1, 4 - 1],
\ ],
\ '[] leave #3': [
\ ["[", ['[]'], 1, 2 - 1],
\ [" x \<Left>\<Left>", ['[ x ]'], 1, 5 - 1],
\ ["]", ['[ x ]'], 1, 8 - 1],
\ ],
\ '[] leave #4': [
\ ["[", ['[]'], 1, 2 - 1],
\ ["\<Enter>x\<Enter>\<Up>\<Right>", ['[', 'x', ']'], 2, 2 - 1],
\ ["]", ['[', 'x', ']'], 3, 2 - 1],
\ ],
\ '[] undo #1': [
\ ["[", ['[]'], 1, 2 - 1],
\ ["x", ['[x]'], 1, 3 - 1],
Expand Down Expand Up @@ -893,6 +903,8 @@ describe 'The default configuration'
\ '[] escape',
\ '[] leave #1',
\ '[] leave #2',
\ '[] leave #3',
\ '[] leave #4',
\ '[] undo #1',
\ '[] undo #2',
\ '{} complete',
Expand Down

0 comments on commit 43931fb

Please sign in to comment.