Add option to allow nesting quotes. #24

This commit is contained in:
Israel Chauca Fuentes
2010-06-28 13:18:04 -05:00
parent 63f8c2af4f
commit fa1d3b3d6a

View File

@@ -43,6 +43,9 @@ function! delimitMate#Init() "{{{
call delimitMate#option_init("quotes", "\" ' `") call delimitMate#option_init("quotes", "\" ' `")
call delimitMate#option_init("quotes_list", split(b:_l_delimitMate_quotes)) call delimitMate#option_init("quotes_list", split(b:_l_delimitMate_quotes))
" nesting_quotes
call delimitMate#option_init("nesting_quotes", [])
" excluded_regions " excluded_regions
call delimitMate#option_init("excluded_regions", "Comment") call delimitMate#option_init("excluded_regions", "Comment")
call delimitMate#option_init("excluded_regions_list", split(b:_l_delimitMate_excluded_regions, ',\s*')) call delimitMate#option_init("excluded_regions_list", split(b:_l_delimitMate_excluded_regions, ',\s*'))
@@ -444,7 +447,8 @@ function! delimitMate#QuoteDelim(char) "{{{
if line[col] == "\\" if line[col] == "\\"
" Seems like a escaped character, insert one quotation mark. " Seems like a escaped character, insert one quotation mark.
return a:char return a:char
elseif line[col + 1] == a:char elseif line[col + 1] == a:char &&
\ index(b:_l_delimitMate_nesting_quotes, a:char) < 0
" Get out of the string. " Get out of the string.
"return delimitMate#WriteBefore(a:char) "return delimitMate#WriteBefore(a:char)
return a:char . delimitMate#Del() return a:char . delimitMate#Del()