fix(folds): allow overlay virtual text on folded line (#23892)

Also always check for fi_level before fi_lines.
This commit is contained in:
zeertzjq
2023-06-03 18:44:08 +08:00
committed by GitHub
parent 40db569014
commit 0e01e81552
4 changed files with 87 additions and 48 deletions

View File

@@ -1985,7 +1985,7 @@ static void win_update(win_T *wp, DecorProviders *providers)
if (wp->w_p_cul) {
// Make sure that the cursorline on a closed fold is redrawn
cursorline_fi = fold_info(wp, wp->w_cursor.lnum);
if (cursorline_fi.fi_level > 0 && cursorline_fi.fi_lines > 0) {
if (cursorline_fi.fi_level != 0 && cursorline_fi.fi_lines > 0) {
wp->w_cursorline = cursorline_fi.fi_lnum;
}
}
@@ -2231,8 +2231,8 @@ static void win_update(win_T *wp, DecorProviders *providers)
// Display one line
spellvars_T zero_spv = { 0 };
row = win_line(wp, lnum, srow, foldinfo.fi_lines ? srow : wp->w_grid.rows, false,
foldinfo.fi_lines ? &zero_spv : &spv,
row = win_line(wp, lnum, srow, foldinfo.fi_lines > 0 ? srow : wp->w_grid.rows, false,
foldinfo.fi_lines > 0 ? &zero_spv : &spv,
foldinfo, &line_providers, &provider_err);
if (foldinfo.fi_lines == 0) {