Better handling of syntax regions

This commit is contained in:
Israel Chauca Fuentes
2017-02-11 22:38:13 -05:00
parent 6f038350de
commit 8204ab4cb8
2 changed files with 9 additions and 1 deletions

View File

@@ -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

View File

@@ -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