Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.foldtext

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.foldtext
import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { foldtext } = fn;

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>