mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
Remove special code to rerender views on screen mode change
The previous commit handles this case too.
This commit is contained in:
parent
d5b4f7bb3e
commit
58a83b0862
1 changed files with 1 additions and 25 deletions
|
@ -1,7 +1,6 @@
|
||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/jesseduffield/gocui"
|
|
||||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,7 +16,7 @@ func (self *ScreenModeActions) Next() error {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.rerenderViewsWithScreenModeDependentContent()
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *ScreenModeActions) Prev() error {
|
func (self *ScreenModeActions) Prev() error {
|
||||||
|
@ -28,32 +27,9 @@ func (self *ScreenModeActions) Prev() error {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.rerenderViewsWithScreenModeDependentContent()
|
|
||||||
}
|
|
||||||
|
|
||||||
// these views need to be re-rendered when the screen mode changes. The commits view,
|
|
||||||
// for example, will show authorship information in half and full screen mode.
|
|
||||||
func (self *ScreenModeActions) rerenderViewsWithScreenModeDependentContent() error {
|
|
||||||
// for now we re-render all list views.
|
|
||||||
for _, context := range self.c.Context().AllList() {
|
|
||||||
if err := self.rerenderView(context.GetView()); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *ScreenModeActions) rerenderView(view *gocui.View) error {
|
|
||||||
context, ok := self.c.Helpers().View.ContextForView(view.Name())
|
|
||||||
if !ok {
|
|
||||||
self.c.Log.Errorf("no context found for view %s", view.Name())
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return context.HandleRender()
|
|
||||||
}
|
|
||||||
|
|
||||||
func nextIntInCycle(sl []types.WindowMaximisation, current types.WindowMaximisation) types.WindowMaximisation {
|
func nextIntInCycle(sl []types.WindowMaximisation, current types.WindowMaximisation) types.WindowMaximisation {
|
||||||
for i, val := range sl {
|
for i, val := range sl {
|
||||||
if val == current {
|
if val == current {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue