patch 8.1.0527: using 'shiftwidth' from wrong buffer for folding
Problem: Using 'shiftwidth' from wrong buffer for folding.
Solution: Use "buf" instead of "curbuf". (Christian Brabandt)
diff --git a/src/fold.c b/src/fold.c
index bc79acc..eb344c4 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -155,6 +155,7 @@
int low_level = 0;
checkupdate(win);
+
/*
* Return quickly when there is no folding at all in this window.
*/
@@ -3219,7 +3220,7 @@
flp->lvl = -1;
}
else
- flp->lvl = get_indent_buf(buf, lnum) / get_sw_value(curbuf);
+ flp->lvl = get_indent_buf(buf, lnum) / get_sw_value(buf);
if (flp->lvl > flp->wp->w_p_fdn)
{
flp->lvl = flp->wp->w_p_fdn;