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.

Unstaged changes view goes weird after staging a hunk #2550

Open

Description

@macdonaldtomw

Prerequisites

Description

When viewing unstaged changes for a file, sometimes when I click on "Stage Hunk", the view jumps down to a seemingly random place. When I scroll back up, the hunk that I just staged is still visible in the "Unstaged changes" view. If I go to the "Staged changes" view, the hunk that I just staged is shown. If I go back to "Unstaged changes" view, the hunk is no longer visible.

This only seems to happen in some files and not others...

Here is a video demonstrating the problem in safe mode, with factory default settings: https://youtu.be/-jeOiUgCPLg

Steps to Reproduce

  1. Open "Unstaged changes" view
  2. Click on "Stage hunk" for one of the unstaged hunks

Expected behavior:

After clikcing "Stage hunk", expect this hunk to disappear from "Unstaged changes" view, and that the next unstaged hunk moves up in the view.

Actual behavior:

Here is a video showing the actual behaviour:

https://youtu.be/-jeOiUgCPLg

After clicking "Stage hunk", the "Unstaged changes" view jumps down to a seemingly random unrelated hunk elsewhere. After scrolling back up to the hunk I had tried to stage, it is still visible in the "Unstaged changes" view, except the line numbers in the gutter no longer make sense (the hunk I just staged seems to now have the line numbers from the next unstaged hunk sitting in the gutter beside it). If I go to "Staged changes" view, I see that the hunk did in fact get staged. If I go back to "Unstaged changes" view, the hunk is no longer there.

Reproduces how often:

100% of the time.

Versions

C:\Users\Boompy>atom --version

Atom : 1.52.0
Electron: 6.1.12
Chrome : 76.0.3809.146
Node : 12.4.0

C:\Users\Boompy>apm --version
apm 2.5.2
npm 6.14.8
node 12.4.0 x64
atom 1.52.0
python 3.8.3
git 2.16.2.windows.1
visual studio 2015

Windows 10 Home (64 bit)

image

Additional Information

Here is the file that I was trying to stage/unstage hunks from:

CM_comm_protocol.zip

I tried moving the base file to a different repositoy, commit, then apply all the same changes. When trying to stage those changes, I get a totally different flavor of bug. It seems like this bug may have something to do with the fact that the file that I am trying to stage diff hunks from is considered by atom to have a "large diff", and therefore the diff does not auto-load? See #799

Maybe it will help diagnose the issue?

Actual behavior:

Here is a video showing the actual behaviour:

https://youtu.be/zox8HrWV-wM

After clicking "Stage hunk", the "Unstaged changes" view seems to bring back the "load diff" message. If I click "load diff", then the unstaged change view displays the correct unstaged changes, except with no diff highlighting. See https://youtu.be/-jeOiUgCPLg

Activity

  1. changed the title [-]Unstaged changes view jumps bottom and doesn't update after staging a hunk[/-] [+]Unstaged changes view goes weird after staging a hunk[/+] on Oct 26, 2020
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