From 3ae285424c48f4d77c19b828e5c0d75d36dc2f90 Mon Sep 17 00:00:00 2001 From: Israel Chauca Fuentes Date: Mon, 28 Jun 2010 15:20:32 -0500 Subject: [PATCH] Expand smart quotes to consider [:alnum:] to the right. --- autoload/delimitMate.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index 79895ea..deb058a 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -450,11 +450,11 @@ function! delimitMate#QuoteDelim(char) "{{{ elseif line[col + 1] == a:char && \ index(b:_l_delimitMate_nesting_quotes, a:char) < 0 " Get out of the string. - "return delimitMate#WriteBefore(a:char) return a:char . delimitMate#Del() - elseif (line[col] =~ '[a-zA-Z0-9]' && a:char == "'") || - \(line[col] =~ '[a-zA-Z0-9]' && b:_l_delimitMate_smart_quotes) - " Seems like an apostrophe or a closing, insert a single quote. + elseif (line[col] =~ '[[:alnum:]]' && a:char == "'") || + \(line[col] =~ '[[:alnum:]]' && b:_l_delimitMate_smart_quotes) || + \(line[col + 1] =~ '[[:alnum:]]' && b:_l_delimitMate_smart_quotes) + " Seems like an apostrophe or a smart quote case, insert a single quote. return a:char elseif (line[col] == a:char && line[col + 1 ] != a:char) && b:_l_delimitMate_smart_quotes " Seems like we have an unbalanced quote, insert one quotation mark and jump to the middle.