From 877df2f0845f2d1342566fd36a549eff69979744 Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 31 Jul 2020 13:41:57 +0100 Subject: [PATCH] fix fold indentation for tabs --- init.fold-text.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.fold-text.vim b/init.fold-text.vim index a80b900..a8994b1 100644 --- a/init.fold-text.vim +++ b/init.fold-text.vim @@ -19,6 +19,14 @@ function! MyFoldText() " don't display vim comment quotation marks " TODO other comment markers let l:line = substitute(l:line, "\^\"\\s\\?", '', '') + " TODO replace spaces with tabs if appropriate + + " replace tabs with spaces if expandtab + if &expandtab == 0 + let l:tabwidth = &tabstop + let l:tabspace = ' '[1:l:tabwidth] + let l:line = substitute(l:line, ' ', l:tabspace, 'g') + endif " let l:postfix = l:linecount . ' ' . substitute(v:folddashes, '-', '•', 'g') let l:postfix = l:linecount . ' ' . substitute(v:folddashes, '-', '↓', 'g')