Skip to content

InsertLineAbove moves cursor from second line to first after inserting line, when first line is blank. #1107

Closed

Description

@msftrncs

Environment data

PSReadline 2.0.0-beta5
Terminal must be capable of triggering InsertLineAbove keybinding.

Steps to reproduce

Referencing #1081 (comment), trigger the keybinding for InsertLineAbove while sitting at the beginning of the second line. (activate it once, to get two lines, then press DOWN and activate it again)

Edit: The first line must be blank in order to demonstrate the issue.

Before:
image

Result is:
image

Anywhere else, the cursor will remain on the same line.

Activity

  1. msftrncs commented on Oct 20, 2019

    @msftrncs
    CollaboratorAuthor

    I have narrowed down where this is coming from, A PR will be forth coming.

    An ArgumentOutOfRangeException is possible if the buffer is filled in this manner while the cursor is effectively on the first line of the input, due to the cursor attempting to move from the second line back to the first after it has already scrolled off the buffer.

    /cc: Keith Hill (@rkeithhill)

  2. changed the title [-]InsertLineAbove moves cursor from second line to first after inserting line[/-] [+]InsertLineAbove moves cursor from second line to first after inserting line, when first line is blank.[/+] on Oct 20, 2019
  3. added 4 commits that reference this issue on Oct 20, 2019
    640dce9
    94974b8
    61ec70b
    d6197e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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