Consider | for matchpairs. Also some minor formatting. Fix #155.

This commit is contained in:
Israel Chauca Fuentes
2014-01-04 16:43:45 -05:00
parent f00f6b6cf2
commit 54853a954c
2 changed files with 15 additions and 20 deletions

View File

@@ -471,13 +471,15 @@ function! delimitMate#ExpandReturn() "{{{
endif
let escaped = delimitMate#CursorIdx() >= 2
\ && delimitMate#GetCharFromCursor(-2) == '\'
if !pumvisible() && (
\ delimitMate#WithinEmptyMatchpair()
\ || (s:g('expand_cr') == 2
\ && index(s:g('right_delims'), delimitMate#GetCharFromCursor(0)) > -1)
\ || (s:g('expand_inside_quotes')
\ && delimitMate#WithinEmptyQuotes()
\ && !escaped))
let expand_right_matchpair = s:g('expand_cr') == 2
\ && index(s:g('right_delims'), delimitMate#GetCharFromCursor(0)) > -1
let expand_inside_quotes = s:g('expand_inside_quotes')
\ && delimitMate#WithinEmptyQuotes()
\ && !escaped
if !pumvisible()
\ && (delimitMate#WithinEmptyMatchpair()
\ || expand_right_matchpair
\ || expand_inside_quotes)
" Expand:
" XXX zv prevents breaking expansion with syntax folding enabled by
" InsertLeave.
@@ -493,10 +495,10 @@ function! delimitMate#ExpandSpace() "{{{
endif
let escaped = delimitMate#CursorIdx() >= 2
\ && delimitMate#GetCharFromCursor(-2) == '\'
if delimitMate#WithinEmptyMatchpair()
\ || (s:g('expand_inside_quotes')
\ && delimitMate#WithinEmptyQuotes()
\ && !escaped)
let expand_inside_quotes = s:g('expand_inside_quotes')
\ && delimitMate#WithinEmptyQuotes()
\ && !escaped
if delimitMate#WithinEmptyMatchpair() || expand_inside_quotes
" Expand:
return "\<Space>\<Space>\<Left>"
else