mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-08 05:34:45 +08:00
Modify QuoteDelim() to be smart about vim comments
Add simple check into QuoteDelim() that checks if the user is about to start a comment in vim files. If that's the case, don't balance it.
This commit is contained in:
@@ -361,6 +361,10 @@ function! delimitMate#QuoteDelim(char) "{{{
|
|||||||
elseif char_at == a:char
|
elseif char_at == a:char
|
||||||
" Inside an empty pair, jump out
|
" Inside an empty pair, jump out
|
||||||
return a:char . "\<Del>"
|
return a:char . "\<Del>"
|
||||||
|
elseif &ft == "vim" && a:char == '"' && getline('.') =~ '^\s*$'
|
||||||
|
" If we are in a vim file and it looks like we're starting a comment, do
|
||||||
|
" not add a second
|
||||||
|
return a:char
|
||||||
elseif delimitMate#IsSmartQuote(a:char)
|
elseif delimitMate#IsSmartQuote(a:char)
|
||||||
" Seems like a smart quote, insert a single char.
|
" Seems like a smart quote, insert a single char.
|
||||||
return a:char
|
return a:char
|
||||||
|
|||||||
Reference in New Issue
Block a user