diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index deb058a..a505ca6 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -53,8 +53,9 @@ function! delimitMate#Init() "{{{ call delimitMate#option_init("excluded_regions_enabled", enabled) " visual_leader - call delimitMate#option_init("visual_leader", exists('b:maplocalleader') ? b:maplocalleader : - \ exists('g:mapleader') ? g:mapleader : "\\") + let leader = exists('b:maplocalleader') ? b:maplocalleader : + \ exists('g:mapleader') ? g:mapleader : "\\" + call delimitMate#option_init("visual_leader", leader) " expand_space if exists("b:delimitMate_expand_space") && type(b:delimitMate_expand_space) == type("") @@ -452,8 +453,9 @@ function! delimitMate#QuoteDelim(char) "{{{ " Get out of the string. return a:char . delimitMate#Del() elseif (line[col] =~ '[[:alnum:]]' && a:char == "'") || - \(line[col] =~ '[[:alnum:]]' && b:_l_delimitMate_smart_quotes) || - \(line[col + 1] =~ '[[:alnum:]]' && b:_l_delimitMate_smart_quotes) + \ (b:_l_delimitMate_smart_quotes && + \ (line[col] =~ '[[:alnum:]]' || + \ line[col + 1] =~ '[[:alnum:]]')) " Seems like an apostrophe or a smart quote case, insert a single quote. return a:char elseif (line[col] == a:char && line[col + 1 ] != a:char) && b:_l_delimitMate_smart_quotes diff --git a/plugin/delimitMate.vim b/plugin/delimitMate.vim index f69edee..163ee6d 100644 --- a/plugin/delimitMate.vim +++ b/plugin/delimitMate.vim @@ -8,8 +8,8 @@ " Initialization: {{{ -if exists("g:loaded_delimitMate") - " User doesn't want this plugin, let's get out! +if exists("g:loaded_delimitMate") || &cp + " User doesn't want this plugin or compatible is set, let's get out! finish endif let g:loaded_delimitMate = 1