Open
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:
- a dedicated function is added to core to translate to virtual line numbers.
- 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.