jesseduffield / jesseduffield/lazygit
Regression: flicker on main window
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
Back in 2021 this commit https://github.com/jesseduffield/lazygit/commit/3fb478a30e5c88af10c6e1e90eb22c99113f2967 created a regression where the main window flickers whenever, say, a file is staged. This is annoying, given that typically when you stage a file, the content in the main window doesn't change.
The original issue with flickering was caused by us clearing a view's viewLines slice in order to write the new content to the view. The screen would refresh while that slice was empty which would lead to a blank view momentarily. We fixed this by not clearing the viewLines slice but instead resetting the write pointer to the beginning of that slice and overwriting it character by character, so that if we had the same content before and after, there would be no difference.
I'm not actually sure what's broken now: looking at the code it appears we're still not clearing the viewLines slice.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a file change
2. stage/unstage the file in quick succession
3. observe the main window flickers (goes momentarily blank)
**Expected behavior**
No flicker
Contributor guide
Assessment
This issue has not been assessed yet.