From 24cffe07b32316d9cb33c519d0d4fef925e016c6 Mon Sep 17 00:00:00 2001 From: Israel Chauca Fuentes Date: Fri, 10 Feb 2017 21:13:45 -0500 Subject: [PATCH] Consider that double quotes start comments in viml --- autoload/delimitMate.vim | 1 + test/autoclose_quotes.vim | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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()