Skip to content

Fold API #16

Open
Open
@lewis6991

Description

In order to render a scrollbar, we need to know information about the visible (aka virtual) lines.

Currently Neovim only provides one function we can use to get this information: vim.fn.foldclosedend(). From this we can create a lazy virtual line index map so we can translate from buffer lnum to virtual lnum.

This is very inefficient as it has to be updated every time these is a change to folds. This lookup function can be made much more efficient if either:

  1. a dedicated function is added to core to translate to virtual line numbers.
  2. An API is provided to get information on the current buffer folds.

Finally we will also need information on virtual lines provided by earmarks as these should influence the rendering of a scrollbar.

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions