Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Selected hunk or line do not stay selected if a new changed line is added or removed above it #1984

Open
@smashwilson

Description

@smashwilson

Prerequisites

Description

In a MultiFilePatchView, the selection is not maintained correctly if any of the following situations:

Steps to Reproduce

  1. Open Atom on a git repository containing at least one modified file.
  2. Open a ChangedFileItem on one file by clicking it on the git tab.
  3. Select a changed line other than the first changed line.
  4. Open a TextEditor on the same file.
  5. Add a line above the selected change and save the file.

Expected behavior:

The same logical line within the diff should be selected within the ChangedFileItem.

Actual behavior:

The changed line above the previously selected line is selected.

Reproduces how often:

100%

Versions

[email protected] (atom/github#2d67c14d)

Additional Information

selection-glitch

There's a pretty hard sub-problem hiding within this one, which is that it's really hard to identify "the same line" between two Patch instances. We might need to do some kind of diff between the diffs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions