mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-06 12:44:27 +08:00
Fixed quotes, for re-do.
This commit is contained in:
@@ -243,16 +243,19 @@ function! delimitMate#QuoteDelim(char) "{{{
|
|||||||
return a:char
|
return a:char
|
||||||
elseif line[col + 1] == a:char
|
elseif line[col + 1] == a:char
|
||||||
" Get out of the string.
|
" Get out of the string.
|
||||||
return delimitMate#WriteBefore(a:char)
|
"return delimitMate#WriteBefore(a:char)
|
||||||
|
return a:char . delimitMate#Del()
|
||||||
elseif (line[col] =~ '[a-zA-Z0-9]' && a:char == "'") ||
|
elseif (line[col] =~ '[a-zA-Z0-9]' && a:char == "'") ||
|
||||||
\(line[col] =~ '[a-zA-Z0-9]' && b:delimitMate_smart_quotes)
|
\(line[col] =~ '[a-zA-Z0-9]' && b:delimitMate_smart_quotes)
|
||||||
" Seems like an apostrophe or a closing, insert a single quote.
|
" Seems like an apostrophe or a closing, insert a single quote.
|
||||||
return a:char
|
return a:char
|
||||||
elseif (line[col] == a:char && line[col + 1 ] != a:char) && b:delimitMate_smart_quotes
|
elseif (line[col] == a:char && line[col + 1 ] != a:char) && b:delimitMate_smart_quotes
|
||||||
" Seems like we have an unbalanced quote, insert one quotation mark and jump to the middle.
|
" Seems like we have an unbalanced quote, insert one quotation mark and jump to the middle.
|
||||||
|
call insert(b:delimitMate_buffer, a:char)
|
||||||
return delimitMate#WriteAfter(a:char)
|
return delimitMate#WriteAfter(a:char)
|
||||||
else
|
else
|
||||||
" Insert a pair and jump to the middle.
|
" Insert a pair and jump to the middle.
|
||||||
|
call insert(b:delimitMate_buffer, a:char)
|
||||||
call delimitMate#WriteAfter(a:char)
|
call delimitMate#WriteAfter(a:char)
|
||||||
return a:char
|
return a:char
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if v:version < 700
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let s:loaded_delimitMate = 1 " }}}
|
let s:loaded_delimitMate = 1 " }}}
|
||||||
let delimitMate_version = '2.0'
|
let delimitMate_version = '2.1_DEV'
|
||||||
|
|
||||||
function! s:Init() "{{{
|
function! s:Init() "{{{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user