jesseduffield / jesseduffield/lazygit

Cursor jumping when staging deleted part of moved file

Open
#2,524 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Describe the bug**
When I move a file, first stage the `A` version at the new location and then stage the `D` version at the old location, the cursor jumps up to the new location. This can be inconvenient and unexpected when moving many files to a subdirectory. Furthermore this behavior only happens when the `A` file is staged first and the `D` second, the other way around works fine.

**To Reproduce**
Steps to reproduce the behavior:

- add a few file to a repo and commit them
- move the files to a subfolder, open lazygit and stage the `A` versions of the files in the subfolder
- stage a `D` version in the old location
- observe that the file at the new `A` location (now `R`) gets selected

**Expected behavior**
The cursor should stay were the deleted file was staged so the user does not have to scroll around to continue where they left off.

**Screenshots**
![](https://s2.gifyu.com/images/Peek-2023-03-29-15-53.gif)

**Version info:**
```
commit=d1a8b05401ccda1e52215203139a252eb3be3b79, build date=2022-11-14T09:22:31Z, build source=binaryRelease, version=0.36.0, os=linux, arch=amd64, git version=2.34.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.