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
Description
Prerequisites
- Have you tried to reproduce the problem in Safe Mode?
- Have you followed all applicable steps in the debugging guide?
- Have you checked the FAQs on the message board for common solutions?
- Have you checked that your issue isn't already filed?
Description
In a MultiFilePatchView, the selection is not maintained correctly if any of the following situations:
- The diff is updated to account for external changes and hunks or lines are added above the current selection.
- A FilePatch is collapsed or expanded (collapse large diffs && collapse/expand any diff within multi file patch view #1913) above the current selection.
Steps to Reproduce
- Open Atom on a git repository containing at least one modified file.
- Open a ChangedFileItem on one file by clicking it on the git tab.
- Select a changed line other than the first changed line.
- Open a TextEditor on the same file.
- 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
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?