Skip to content

Persistent state - #86

Open
bellhyve wants to merge 40 commits into
gj1118:masterfrom
bellhyve:persistent_state
Open

Persistent state#86
bellhyve wants to merge 40 commits into
gj1118:masterfrom
bellhyve:persistent_state

Conversation

@bellhyve

@bellhyve bellhyve commented Aug 4, 2026

Copy link
Copy Markdown

Here's a working implementation of persistence. It's three-way merged from your excellent fork and a popular (abandoned) Helix PR, Persistent state - #9143, including:

  • persistent command history
  • persistent search history
  • persistent file history
  • persistent clipboard contents

Everything has the functionality and config knobs we'd expect, and it appears to work quite well; I've tested all the options listed in your README.md alongside it. I also generated an merge playbook in docs/persistence-merge-notes.md to hopefully simplify the process for future editors. Note that this merge involved me throwing a few quarters into the old clank tank (AI agents), so though I read over everything, it needs the review of an experienced Rust developer.

Thanks so much for the amazing curation of Helix!

currently only writes the header when closing
will probably need a sophisticated way of handling this eventually for
testing shada behaviour, but for now this is fine
It was necessary make pos in file args an option to prevent it from
overwriting the file positions loaded from persistence.

Alignment is not quite right... I think we need to persist selections
instead of view positions, or disable center aligning
encoding was found to be necessary because registers can contain line
endings, which breaks the previous lines-of-text format
useful in the case of bare git repos, where the git dir is not always
named .git, and so the previous exclusion wouldn't catch it.
intarga and others added 8 commits December 23, 2024 13:58
Vendors helix-editor#9143 (intarga/persistent_state) onto gj1118.

Persists (opt-in via [editor.persistence]):
- command history (:)
- search history (/)
- file cursor positions (old-files)
- internal clipboard

State lives under ~/.local/state/helix (bincode). Defaults all off.

Also: skip applying implicit CLI Position::default() after open so
old-files restore is not clobbered; :reload-history command; integration
test.
@socket-security

socket-security Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedbincode@​1.3.310010093100100
Addedserde_regex@​1.2.010010093100100

View full report

@bellhyve

bellhyve commented Aug 7, 2026

Copy link
Copy Markdown
Author

FYI, I did forget fmt but the rest of the red CI was codeberg 504 on the tree sitter pulls.

These tests will pass if codeberg is awake today. Tested ok on my end!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants