From 03e94587ae3b7b6202577d86a2e9a83df1585273 Mon Sep 17 00:00:00 2001 From: Tibor Claassen Date: Sat, 28 Mar 2015 15:48:40 +0200 Subject: [PATCH] Add a guard clause to disable expansion for excluded filetypes --- autoload/delimitMate.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index ec08525..ec5939a 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -196,7 +196,17 @@ function! s:get_syn_name() "{{{ return synIDattr(synIDtrans(synID(line('.'), col, 1)), 'name') endfunction " }}} +function! s:is_excluded_ft(ft) "{{{ + if !exists("g:delimitMate_excluded_ft") + return 0 + endif + return index(split(g:delimitMate_excluded_ft, ','), a:ft, 0, 1) >= 0 +endfunction "}}} + function! s:is_forbidden(char) "{{{ + if s:is_excluded_ft(&filetype) + return 1 + endif if !s:get('excluded_regions_enabled') return 0 endif