Finished <S-Tab> for expansions.

This commit is contained in:
Israel Chauca Fuentes
2010-04-06 14:02:05 -05:00
parent 7540b37e8f
commit 6b80cfefb6

View File

@@ -201,41 +201,32 @@ function! DelimitMate_ShouldJump() "{{{
let char = getline('.')[col - 1] let char = getline('.')[col - 1]
let nchar = getline('.')[col] let nchar = getline('.')[col]
let uchar = getline(line('.') + 1)[0] let uchar = getline(line('.') + 1)[0]
for pair in b:delimitMate_matchpairs_list
if char == split( pair, ':' )[1] for cdel in b:delimitMate_right_delims + b:delimitMate_quotes_list
" Closing delimiter on the rigth, jump over it. if char == cdel
" Closing delimiter on the right.
return 1 return 1
elseif b:delimitMate_expand_space && endif
\ char == " " && endfor
\ nchar == split( pair, ':' )[1]
" Closing delimiter on the right after an space and space expansion if b:delimitMate_expand_space && char == " "
" enabled. for cdel in b:delimitMate_right_delims + b:delimitMate_quotes_list
return 1 if nchar == cdel
elseif b:delimitMate_expand_cr && " Closing delimiter with space expansion.
\ col == lcol &&
\ uchar == split( pair, ':' )[1]
" Closing delimiter starting the next line, at the end of the
" current line and expand CR enabled.
return 1 return 1
endif endif
endfor
endif
endfor if b:delimitMate_expand_cr && char == ""
for quote in b:delimitMate_quotes_list for cdel in b:delimitMate_right_delims + b:delimitMate_quotes_list
if char == quote if uchar == cdel
" Closing delimiter on the rigth, jump over it. " Closing delimiter with CR expansion.
return 1
elseif b:delimitMate_expand_space && char == " " && nchar == quote
" Closing delimiter on the right after an space and expand space
" enabled.
return 1
elseif b:delimitMate_expand_cr &&
\ col == lcol &&
\ uchar == quote
" Closing delimiter starting the next line, at the end of the
" current line and expand CR enabled.
return 1 return 1
endif endif
endfor endfor
endif
return 0 return 0
endfunction "}}} endfunction "}}}