1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

commit files kind of generalised

This commit is contained in:
Jesse Duffield
2020-08-21 19:53:45 +10:00
parent ddf25e14af
commit 2d90e1e8ee
16 changed files with 156 additions and 102 deletions

View File

@ -41,6 +41,8 @@ type Context interface {
HandleRender() error
GetKind() int
GetViewName() string
GetWindowName() string
SetWindowName(string)
GetKey() string
GetSelectedItemId() string
SetParentContext(Context)
@ -56,6 +58,15 @@ type BasicContext struct {
ViewName string
}
func (c BasicContext) SetWindowName(windowName string) {
panic("can't set window name on basic context")
}
func (c BasicContext) GetWindowName() string {
// TODO: fix this up
return c.GetViewName()
}
func (c BasicContext) SetParentContext(Context) {
panic("can't set parent context on basic context")
}
@ -433,6 +444,7 @@ func (gui *Gui) activateContext(c Context) error {
}
}
// ensure that any other window for which this view was active is now set to the default for that window.
gui.setViewAsActiveForWindow(viewName)
if viewName == "main" {