Reorder some logic.

This commit is contained in:
Israel Chauca Fuentes
2010-07-15 04:07:56 -05:00
parent 9e3075cff5
commit e9491e473c
2 changed files with 8 additions and 6 deletions

View File

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

View File

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