aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawscreen.c
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-22 10:13:35 +0000
committerGitHub <noreply@github.com>2024-01-22 10:13:35 +0000
commit1233ac467de7504b277425988ef9be7f8d3a9626 (patch)
tree0f90618b9a542e3bc859cf03079d8149d10e77e1 /src/nvim/drawscreen.c
parent21b36c7d7fa351544253316c606651e9ce925b29 (diff)
downloadrneovim-1233ac467de7504b277425988ef9be7f8d3a9626.tar.gz
rneovim-1233ac467de7504b277425988ef9be7f8d3a9626.tar.bz2
rneovim-1233ac467de7504b277425988ef9be7f8d3a9626.zip
feat(fold): transparent foldtext
'foldtext' can be set to an empty string to disable and render the line with: - extmark highlight - syntax highlighting - search highlighting - no line wrapping - spelling - conceal - inline virtual text - respects `fillchars:fold` Currently normal virtual text is not displayed Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src/nvim/drawscreen.c')
-rw-r--r--src/nvim/drawscreen.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c
index 9a3fffde07..1cc04d2588 100644
--- a/src/nvim/drawscreen.c
+++ b/src/nvim/drawscreen.c
@@ -2283,22 +2283,28 @@ static void win_update(win_T *wp)
syntax_end_parsing(wp, syntax_last_parsed + 1);
}
+ bool display_buf_line = (foldinfo.fi_lines == 0 || *wp->w_p_fdt == NUL);
+
// Display one line
spellvars_T zero_spv = { 0 };
row = win_line(wp, lnum, srow, wp->w_grid.rows, 0,
- foldinfo.fi_lines > 0 ? &zero_spv : &spv, foldinfo);
+ display_buf_line ? &spv : &zero_spv, foldinfo);
+
+ if (display_buf_line) {
+ syntax_last_parsed = lnum;
+ } else {
+ spv.spv_capcol_lnum = 0;
+ }
if (foldinfo.fi_lines == 0) {
wp->w_lines[idx].wl_folded = false;
wp->w_lines[idx].wl_lastlnum = lnum;
did_update = DID_LINE;
- syntax_last_parsed = lnum;
} else {
foldinfo.fi_lines--;
wp->w_lines[idx].wl_folded = true;
wp->w_lines[idx].wl_lastlnum = lnum + foldinfo.fi_lines;
did_update = DID_FOLD;
- spv.spv_capcol_lnum = 0;
}
}