Skip to main content
Module

x/denops_std/function/mod.ts>foldlevel

📚 Standard module for denops.vim
Go to Latest
function foldlevel
import { foldlevel } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

The result is a Number, which is the foldlevel of line {lnum} in the current buffer. For nested folds the deepest level is returned. If there is no fold at line {lnum}, zero is returned. It doesn't matter if the folds are open or closed. When used while updating folds (from 'foldexpr') -1 is returned for lines where folds are still to be updated and the foldlevel is unknown. As a special case the level of the previous line is usually available. {lnum} is used like with getline(). Thus "." is the current line, "'m" mark m, etc.

Can also be used as a method:

GetLnum()->foldlevel()

Parameters

denops: Denops
lnum: unknown

Returns

Promise<number>