4 Commits

Author SHA1 Message Date
Vasily Toropov
1e9e49d6de Merge 3a7919fdb5 into becbd2d353 2024-08-19 16:09:57 -07:00
Israel Chauca Fuentes
becbd2d353 Merge pull request #308 from kevinhwang91/master
fix: &sw may be a zero
2024-08-06 01:02:38 -05:00
kevinhwang91
382c36bf57 fix: &sw may be a zero
E41: Out of memory!
2024-08-06 12:56:21 +08:00
Vasily Toropov
3a7919fdb5 Fixed closing apostrophe in clojure files 2015-07-26 17:39:30 +10:00

View File

@@ -372,6 +372,9 @@ function! delimitMate#QuoteDelim(char) "{{{
" If we are in a vim file and it looks like we're starting a comment, do " If we are in a vim file and it looks like we're starting a comment, do
" not add a closing char. " not add a closing char.
return a:char return a:char
elseif a:char == "'" && index(split(&ft, '\.'), "clojure") != -1
" If we are in a clojure file, do not add a closing apostrophe.
return a:char
elseif s:is_smart_quote(a:char) elseif s:is_smart_quote(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
@@ -483,8 +486,9 @@ function! delimitMate#ExpandReturn() "{{{
" indentation is controlled by 'smartindent', and the first character on " indentation is controlled by 'smartindent', and the first character on
" the new line is '}'. If this were typed manually it would reindent to " the new line is '}'. If this were typed manually it would reindent to
" match the current line. Let's reproduce that behavior. " match the current line. Let's reproduce that behavior.
let shifts = indent('.') / &sw let sw = &sw == 0 ? &ts : &sw
let spaces = indent('.') - (shifts * &sw) let shifts = indent('.') / sw
let spaces = indent('.') - (shifts * sw)
let val .= "^\<C-D>".repeat("\<C-T>", shifts).repeat(' ', spaces) let val .= "^\<C-D>".repeat("\<C-T>", shifts).repeat(' ', spaces)
endif endif
" Expand: " Expand: