jesseduffield / jesseduffield/lazygit

Input field keeps stale horizontal scroll offset after deletion

Open
#5,633 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 typing into a horizontally scrollable input field, the viewport scrolls correctly once the text exceeds the visible width. However, after deleting characters with backspace, the viewport does not scroll back left to reveal previously hidden text.
Instead, empty space remains on the right side while the earlier part of the input stays hidden.

### To Reproduce
Steps to reproduce the behavior:

1. Open an input field with limited visible width (e.g. commit message, prompt, filter input, etc.)
2. Type enough text to overflow horizontally
3. Continue typing until the viewport scrolls right
4. Press backspace repeatedly
5. Observe that the viewport does not shift back left as the text becomes shorter

### Expected behavior
As characters are deleted and the text length decreases, the horizontal viewport should scroll back left to keep the visible area aligned with the remaining content/cursor position.

### Screenshots
If needed, I can provide a recording.

### Version info:
Output of `lazygit --version`:
`commit=, build date=, build source=unknown, version=unversioned, os=linux, arch=amd64, git version=2.53.0`

Installed lazygit via:
```
$ go install github.com/jesseduffield/lazygit@latest
go: downloading github.com/jesseduffield/lazygit v0.61.1
```

### Terminal info:
Ghostty 1.3.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.