Skip to content

Undoing delete has different behaviour than undoing backspace #493

@neilccbrown

Description

@neilccbrown

Create a bit of text like "abcdef". If you put your cursor at the beginning and hit delete three times, then undo, you undo all three deletions in one go. However, if you put your cursor at the end and hit backspace three times then undo, you undo the deletions one at a time. The reason for this is the test:

&& this.getInsertionEnd() == latter.position

on line 68 of TextChange.mergeWith; delete insertions retain the position so they can merge whereas backspace insertions move the position so they don't get merged. I'm hesitant to suggest the right new test though, because I suspect it's easy to have unintended consequences here. It's not a big issue, but thought I'd note it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions