mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-15 00:47:06 +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
|
endif
|
||||||
let line = getline('.')
|
let line = getline('.')
|
||||||
let col = col('.')-2
|
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 setline('.',a:char.line)
|
||||||
call insert(b:_l_delimitMate_buffer, a:char)
|
call insert(b:_l_delimitMate_buffer, a:char)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -112,6 +112,9 @@ function! s:init() "{{{
|
|||||||
endif
|
endif
|
||||||
call s:option_init("expand_cr", 0)
|
call s:option_init("expand_cr", 0)
|
||||||
|
|
||||||
|
" smart_matchpairs
|
||||||
|
call s:option_init("smart_matchpairs", 1)
|
||||||
|
|
||||||
" smart_quotes
|
" smart_quotes
|
||||||
call s:option_init("smart_quotes", 1)
|
call s:option_init("smart_quotes", 1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user