From 12c5c96ca2bf48c50bdedf2d53ffa00a9a99524a Mon Sep 17 00:00:00 2001 From: Israel Chauca Fuentes Date: Sat, 6 Nov 2010 20:05:40 -0500 Subject: [PATCH] Add smart_matchpairs This option will prevent delimitMate from inserting the closing delimiter when there is a keyword character on the right of the cursor. --- autoload/delimitMate.vim | 5 ++++- plugin/delimitMate.vim | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index 01c6021..6f537a0 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -258,7 +258,10 @@ function! delimitMate#ParenDelim(char) " {{{ endif let line = getline('.') let col = col('.')-2 - if (col) < 0 + if b:_l_delimitMate_smart_matchpairs && + \ line[col+1] =~ '\S' + return '' + elseif (col) < 0 call setline('.',a:char.line) call insert(b:_l_delimitMate_buffer, a:char) else diff --git a/plugin/delimitMate.vim b/plugin/delimitMate.vim index 169cba3..37bc6ed 100644 --- a/plugin/delimitMate.vim +++ b/plugin/delimitMate.vim @@ -112,6 +112,9 @@ function! s:init() "{{{ endif call s:option_init("expand_cr", 0) + " smart_matchpairs + call s:option_init("smart_matchpairs", 1) + " smart_quotes call s:option_init("smart_quotes", 1)