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

Ensure history is completed and cursor is in view after pasting #5790

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

pascalkuthe
Copy link
Member

Fixes #5733

This PR ensures that the cursor is in view and that any changes are appended to history when using typeable commands instead of keybindings. If changes are not saved to history crashes can occur later. For example the reproduction case for #5733 uses middle mouse to trigger the :clipboard-paste-before command which causes the undo command to produce a crash later.

While looking into a fix, I noticed that ensure_cursor_in_view was also not being called. When the cursor is at the EOF (vgegl) of a large file and replaced with a very short string from the clipboard the view currently becomes empty (no visible text or line numbers). That second bug is fixed by adding the ensure_cursor_in_view call.

@pascalkuthe pascalkuthe added C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer. labels Feb 2, 2023
@pascalkuthe
Copy link
Member Author

sorry about the pipline I accidently added an uesless & so clippy complained. Pushed a fix for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helix crashed on "Undo change" (u) [undo]
2 participants