vim-patch:8.1.0527: using 'shiftwidth' from wrong buffer for folding (#9234)

Problem:    Using 'shiftwidth' from wrong buffer for folding.
Solution:   Use "buf" instead of "curbuf". (Christian Brabandt)
0c27cbcacf
This commit is contained in:
Jan Edmund Lazo
2018-11-14 20:10:05 -05:00
committed by Justin M. Keyes
parent e14fa8569c
commit f6ed446817

View File

@@ -171,9 +171,8 @@ bool hasFoldingWin(
int low_level = 0; int low_level = 0;
checkupdate(win); checkupdate(win);
/*
* Return quickly when there is no folding at all in this window. // Return quickly when there is no folding at all in this window.
*/
if (!hasAnyFolding(win)) { if (!hasAnyFolding(win)) {
if (infop != NULL) if (infop != NULL)
infop->fi_level = 0; infop->fi_level = 0;
@@ -2851,8 +2850,9 @@ static void foldlevelIndent(fline_T *flp)
flp->lvl = 0; flp->lvl = 0;
else else
flp->lvl = -1; flp->lvl = -1;
} else } 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) { if (flp->lvl > flp->wp->w_p_fdn) {
flp->lvl = (int) MAX(0, flp->wp->w_p_fdn); flp->lvl = (int) MAX(0, flp->wp->w_p_fdn);
} }