Skip to content

[vi-mode] Undoing a delete moves the cursor at the end of the newly pasted text. #1673

@springcomp

Description

@springcomp

Environments

PS version: 5.1.19041.1
PSReadline version: 2.0.0-beta2
os: 10.0.19041.322 (WinBuild.160101.0800)
PS file version: 10.0.19041.322 (WinBuild.160101.0800)
HostName: ConsoleHost (Windows Terminal)
BufferWidth: 120
BufferHeight: 30

PS version: 7.1.0-preview.2
PSReadline version: 2.0.1
os: 10.0.19041.322 (WinBuild.160101.0800)
PS file version: 7.1.0.0
HostName: ConsoleHost (Windows Terminal)
BufferWidth: 120
BufferHeight: 30

Steps to reproduce

  • Type the following sequence: oneEsc0
    Thus, typing one and positioning the cursor at the beginning of the line.

  • Then, type x to delete one character.

  • Finally, type uto undo.

Expected behavior

The cursor should stay at the beginning of the line. In fact, the cursor should stay at the start position of the deleted text.

Actual behavior

Notice that the cursor is now on the n letter, instead of the o letter, at the beginning of the line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions