I have trouble with one specific folding expression, s1. The documentation (:h fold-expr) says:s1, s2, ..  subtract one, two, .. from the fold level of the            previous lineHowever this is not true for me. Create a file .vim/after/ftplugin/vim/test.vim/ with the following content: This is a demo, the fold starts here. This line has foldlevel 1 This line is folded wrong, it should have foldlevel 0, but has foldlevel 1function! VimFolds(lnum)  let thisline = getline(a:lnum)  if match(thisline, '^') >= 0    return '>1'  elseif match(thisline, '^ ') >= 0    return 's1'  else    return '='  endifendfunctionsetlocal foldmethod=exprsetlocal foldexpr=VimFolds(v:lnum)set foldcolumn=3set foldminlines=0Open the file with Vim, it should be folded according to its own rules. The second line should be on foldlevel 0 according to documentation, but is on foldlevel 1.Am I understanding something wrong here on how to use this?
fold-expr not working as expected
folding
 This is a demo, the fold starts here. This line has foldlevel 1 This line is folded wrong, it should have foldlevel 0, but has foldlevel 1function! VimFolds(lnum)  let thisline = getline(a:lnum)  if thisline =~ '^'    return '>1'  elseif thisline =~ '^ '    return foldlevel(a:lnum-1)-1  else    return foldlevel(a:lnum-1)  endifendfunctionset foldmethod=exprset foldexpr=VimFolds(v:lnum)set foldcolumn=3set foldminlines=0I don't know how to make the 's1' value work as intended either.However the code above seems to do what you want.