sublime_merge
sublime_merge copied to clipboard
Selected hunk is reset after staging a line
Version info
- OS: Windows 11
- Build: 2095
Description
A workspace contains multiple hunks, each of which only a part of is to be staged by only using keyboard navigation.
Steps to reproduce
- Open a repository with multiple changes in worktree
- Open SM's Commit Dialog
- Navigate to any but the first diff hunk hitting
tabkey (multiple times) - use cursor to select some text
- hit
enterto stage the selected text's line - hit
tabkey
Expected behavior
The next diff hunk is selected,
so all desired changes can be added by repeating steps 4 to 6.
Actual behavior
SM forgets its currently focused hunk and therefore focuses first one.
So if a line from hunk 1000 was staged, I now need to hit tab 1001 times to navigate to the next hunk of interest.
That's pretty inefficient.
I came here to report the same bug, I made a video of the issue here: https://www.youtube.com/watch?v=cISOZ4TLNBE
It is even more severe than just being inefficient. When the focus is reset to the top of the file, you presumably skipped over that hunk because you didn't want to stage it. If you accidentally hit enter thinking that you wanted to stage the next hunk that is in your view but instead staged the first hunk that isn't even on the screen.
So now you have to find it inside the staging hunks to unstage it. That is if you knew about the issue, there is no visual confirmation that this has happened.
You could easily think that nothing happened, that the window lost keyboard focus after hitting enter a couple of times, and then use the mouse to stage the next hunk. Not knowing that you have hunks in your staging that you didn't intend—that you might then push.
Which could be destructive.
By the way I'm using an unlicensed version in the video—new machine, I'm lazy and like the light theme—but I do have a license:
Invoice 1021873.
This issue occurs even when there is no selection and Enter is pressed to stage the entire hunk (i.e. skipping step 4 in the OP reproduction). So it's a downright fundamental issue.