1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-19 00:28:03 +02:00

fix glitchy render of stale data when flicking through files and directories

This commit is contained in:
Jesse Duffield
2022-10-02 20:31:40 -07:00
parent a77aa4d75a
commit e76fa5a6cb
6 changed files with 69 additions and 15 deletions

View File

@ -403,6 +403,21 @@ func (g *Gui) SetViewOnTopOf(toMove string, other string) error {
return nil
}
// replaces the content in toView with the content in fromView
func (g *Gui) CopyContent(fromView *View, toView *View) {
g.Mutexes.ViewsMutex.Lock()
defer g.Mutexes.ViewsMutex.Unlock()
toView.clear()
toView.lines = fromView.lines
toView.viewLines = fromView.viewLines
toView.ox = fromView.ox
toView.oy = fromView.oy
toView.cx = fromView.cx
toView.cy = fromView.cy
}
// Views returns all the views in the GUI.
func (g *Gui) Views() []*View {
return g.views