Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/mod.ts>foldtext

๐Ÿ“š Standard module for denops.vim
Go to Latest
function foldtext
import { foldtext } from "https://deno.land/x/denops_std@v5.0.2/function/mod.ts";

Returns a String, to be displayed for a closed fold. This is the default function used for the 'foldtext' option and should only be called from evaluating 'foldtext'. It uses the v:foldstart, v:foldend and v:folddashes variables. The returned string looks like this:

+-- 45 lines: abcdef

The number of leading dashes depends on the foldlevel. The "45" is the number of lines in the fold. "abcdef" is the text in the first non-blank line of the fold. Leading white space, "//" or "/*" and the text from the 'foldmarker' and 'commentstring' options is removed. When used to draw the actual foldtext, the rest of the line will be filled with the fold char from the 'fillchars' setting. Returns an empty string when there is no fold. not available when compiled without the +folding feature

Returns

Promise<string>