Skip to content

Crash when deleting the last line and undoing it. #4869

@phynalle

Description

@phynalle

Summary

Hello! I'm newbie to helix.
I'm working on my toy project with helix to practice it, but it is sometimes and suddenly crashed in a certain situation.
And I figured out how to reproduce it.

Reproduction Steps

  1. Delete line. (x + d)
  2. Go to last line (g + e)
  3. Undo (u)
  4. Try 1~3 again.

I minimized it more like this.

  1. hx
  2. type d + ge + u
  3. type d + ge + u, again
  4. CRASH!

the error message is below:

thread 'main' panicked at 'Position 2 is out of range for changeset len 0!', helix-core\src\transaction.rs:397:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Actually, the minimized steps don't need to go last line.
Typing dudu just makes the helix crash.

Helix log

I tried to log after clearing it. but no words are written.

Platform

Windows

Terminal Emulator

Windows Terminal

Helix Version

helix 22.08.1 (590a628)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-helix-termArea: Helix term improvementsC-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions