Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fold API #16

Open
lewis6991 opened this issue Jun 26, 2022 · 7 comments
Open

Fold API #16

lewis6991 opened this issue Jun 26, 2022 · 7 comments

Comments

@lewis6991
Copy link
Owner

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.

@clason

This comment was marked as resolved.

@lewis6991

This comment was marked as resolved.

@clason

This comment was marked as resolved.

@lewis6991

This comment was marked as resolved.

@clason

This comment was marked as resolved.

@lewis6991
Copy link
Owner Author

Potential alternative solution: neovim/neovim#24236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants