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

Limit the number of items in the jumplist #4750

Merged
merged 1 commit into from
Nov 22, 2022

Commits on Nov 15, 2022

  1. Limit the number of items in the jumplist

    Previously, jumplists could grow unchecked. Every transaction is
    applied to jumplist selections to ensure that they are up to date
    and within document bounds, so this would cause every edit to become
    more expensive as jumplist lengths increased throughout a session.
    Setting a maximum number of entries limits the cost.
    
    Vim and Neovim limit their jumplists:
    
    * https://github.com/vim/vim/blob/b298fe6cbae3b240b10dbd55d9c38d0cc8e033d3/src/structs.h#L141
    * https://github.com/neovim/neovim/blob/e8cc489accc435076afb4fdf89778b64f0a48473/src/nvim/mark_defs.h#L57
    
    Notably, Kakoune does not. In Kakoune, changes are applied to jumplist
    entries lazily as you hit `<C-o>`/`<C-i>` though, so Kakoune doesn't
    have the same growing cost concerns. Kakoune also does not have a
    concept of a View which limits the cost further.
    
    Vim and Neovim limit to 100. This seems unreasonably high to me so I've
    set this to 30 to start. We can increase if this is problematically
    low.
    the-mikedavis committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    60224e9 View commit details
    Browse the repository at this point in the history