From 382c36bf57a03ee90664de347bb516e10a60d361 Mon Sep 17 00:00:00 2001 From: kevinhwang91 Date: Tue, 6 Aug 2024 12:51:59 +0800 Subject: [PATCH] fix: &sw may be a zero E41: Out of memory! --- autoload/delimitMate.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index e6e3a0c..e063c88 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -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 .= "^\".repeat("\", shifts).repeat(' ', spaces) endif " Expand: