mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
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:

committed by
Justin M. Keyes

parent
e14fa8569c
commit
f6ed446817
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user