mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-06 20:54:31 +08:00
Reorder some logic.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user