diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index 3c02540..4c5d192 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -259,8 +259,11 @@ function! delimitMate#ParenDelim(char) " {{{ endif let line = getline('.') let col = col('.')-2 - if b:_l_delimitMate_smart_matchpairs && - \ line[col+1] =~ '\w' + let left = b:_l_delimitMate_left_delims[index(b:_l_delimitMate_right_delims,a:char)] + let smart_matchpairs = substitute(b:_l_delimitMate_smart_matchpairs, '\\!', left, 'g') + "echom left.':'.smart_matchpairs . ':' . matchstr(line[col+1], smart_matchpairs) + if b:_l_delimitMate_smart_matchpairs != '' && + \ line[col+1:] =~ smart_matchpairs return '' elseif (col) < 0 call setline('.',a:char.line) @@ -531,7 +534,7 @@ function! delimitMate#TestMappings() "{{{ endfunction "}}} function! delimitMate#OptionsList() "{{{ - return {'autoclose' : 1,'matchpairs': &matchpairs, 'quotes' : '" '' `', 'nesting_quotes' : [], 'expand_cr' : 0, 'expand_space' : 0, 'smart_quotes' : 1, 'smart_matchpairs' : 1, 'balance_matchpairs' : 0, 'excluded_regions' : 'Comment', 'excluded_ft' : '', 'apostrophes' : ''} + return {'autoclose' : 1,'matchpairs': &matchpairs, 'quotes' : '" '' `', 'nesting_quotes' : [], 'expand_cr' : 0, 'expand_space' : 0, 'smart_quotes' : 1, 'smart_matchpairs' : '\w', 'balance_matchpairs' : 0, 'excluded_regions' : 'Comment', 'excluded_ft' : '', 'apostrophes' : ''} endfunction " delimitMate#OptionsList }}} "}}} diff --git a/plugin/delimitMate.vim b/plugin/delimitMate.vim index dc895ab..a8dfd33 100644 --- a/plugin/delimitMate.vim +++ b/plugin/delimitMate.vim @@ -112,7 +112,7 @@ function! s:init() "{{{ call s:option_init("expand_cr", 0) " smart_matchpairs - call s:option_init("smart_matchpairs", 1) + call s:option_init("smart_matchpairs", '^\%(\w\|\!\)') " smart_quotes call s:option_init("smart_quotes", 1)