diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index db1116e..6161886 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -27,6 +27,7 @@ let s:exprs = [] call add(s:exprs, 'prev_char =~# "\\w"') call add(s:exprs, 'prev_char =~# "[^[:space:][:punct]".escape(join(options.quotes, ""), "\\^[]")."]"') call add(s:exprs, 'next_char =~# "\\w"') +call add(s:exprs, 'char == "\"" && &filetype =~? "\\" && line =~ "^\\s*$"') call add(s:exprs, 'next_char =~# "[^[:space:][:punct]".escape(join(options.quotes, ""), "\\^[]")."]"') " Balance quotes call add(s:exprs, 'strchars(substitute(substitute(a:info.cur.text, "\\\\.", "", "g"), "[^".escape(char, "\\^[]")."]", "", "g")) % 2') diff --git a/test/autoclose_quotes.vim b/test/autoclose_quotes.vim index c4c40ee..60fd66d 100644 --- a/test/autoclose_quotes.vim +++ b/test/autoclose_quotes.vim @@ -74,6 +74,10 @@ unlet g:delimitMate_nesting_quotes iabb def ghi call DMTest_quotes('', "idef'", "ghi'", 'a:typed =~ "^idef[''`«|]"') iunabb def -""call DMTest_quotes('', "'\\", "''") +""call DMTest_quotes('', "i'\\", "''") +" Double quote starts a comment in viml +set ft=vim +call DMTest_single('', 'i"', '"') +set ft= call vimtest#Quit()