From 71530cc972576e6656431b6d000aec9b69a0997e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 17 Sep 2023 20:29:18 +0800 Subject: feat(folds): support virtual text format for 'foldtext' (#25209) Co-authored-by: Lewis Russell --- runtime/doc/fold.txt | 6 ++++-- runtime/doc/news.txt | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index 24d7605e4a..8f7393f5e3 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -520,8 +520,10 @@ expression. It can use these special Vim variables: foldlevel. v:foldlevel the foldlevel of the fold -In the result a TAB is replaced with a space and unprintable characters are -made into printable characters. +If the result is a |List|, it is parsed and drawn like "overlay" virtual text +(see |nvim_buf_set_extmark()|), otherwise the result is converted to a string +where a TAB is replaced with a space and unprintable characters are made into +printable characters. The resulting line is truncated to fit in the window, it never wraps. When there is room after the text, it is filled with the character specified diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 0162a99619..7c971097fb 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -89,6 +89,8 @@ The following new APIs and features were added. • Added inline virtual text support to |nvim_buf_set_extmark()|. +• 'foldtext' now supports virtual text format. |fold-foldtext| + • The terminal buffer now supports reflow (wrapped lines adapt when the buffer is resized horizontally). Note: Lines that are not visible and kept in |'scrollback'| are not reflown. -- cgit