mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-06 12:44:27 +08:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user