2 Commits

Author SHA1 Message Date
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

View File

@@ -483,8 +483,9 @@ function! delimitMate#ExpandReturn() "{{{
" indentation is controlled by 'smartindent', and the first character on
" the new line is '}'. If this were typed manually it would reindent to
" match the current line. Let's reproduce that behavior.
let shifts = indent('.') / &sw
let spaces = indent('.') - (shifts * &sw)
let sw = &sw == 0 ? &ts : &sw
let shifts = indent('.') / sw
let spaces = indent('.') - (shifts * sw)
let val .= "^\<C-D>".repeat("\<C-T>", shifts).repeat(' ', spaces)
endif
" Expand: