mirror of
https://github.com/Raimondi/delimitMate.git
synced 2026-01-21 10:32:18 +08:00
Better handling of syntax regions
This commit is contained in:
@@ -245,7 +245,8 @@ function! delimitMate#InsertCharPre(str) "{{{1
|
||||
echom 03
|
||||
return 0
|
||||
endif
|
||||
if !empty(filter(s:option('excluded_regions'), 'index(s:synstack(line("."), col(".")), v:val) >= 0'))
|
||||
let synstack = join(map(synstack(line('.'), col('.')), 'tolower(synIDattr(v:val, "name"))'), ',')
|
||||
if !empty(filter(s:option('excluded_regions'), 'stridx(synstack, tolower(v:val)) >= 0'))
|
||||
echom 04
|
||||
return 0
|
||||
endif
|
||||
|
||||
@@ -85,6 +85,13 @@ let g:delimitMate_autoclose = 1
|
||||
let g:delimitMate_balance_pairs = 1
|
||||
call DMTest_pairs('ab cd)', "la(x", 'ab(x cd)')
|
||||
|
||||
" Disable on syntax groups
|
||||
new
|
||||
syntax on
|
||||
set ft=vim
|
||||
call DMTest_pairs('echo " "', "f\"la(", 'echo " ( "')
|
||||
syntax off
|
||||
bp
|
||||
|
||||
call vimtest#Quit()
|
||||
" vim: sw=2 et
|
||||
|
||||
Reference in New Issue
Block a user