mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
genericise creating new branches off things
This commit is contained in:
@ -46,6 +46,7 @@ type Context interface {
|
||||
SetWindowName(string)
|
||||
GetKey() string
|
||||
GetSelectedItemId() string
|
||||
GetSelectedItem() ListItem
|
||||
SetParentContext(Context)
|
||||
GetParentContext() Context
|
||||
}
|
||||
@ -63,6 +64,10 @@ func (c BasicContext) SetWindowName(windowName string) {
|
||||
panic("can't set window name on basic context")
|
||||
}
|
||||
|
||||
func (c BasicContext) GetSelectedItem() ListItem {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c BasicContext) GetWindowName() string {
|
||||
// TODO: fix this up
|
||||
return c.GetViewName()
|
||||
@ -677,3 +682,14 @@ func (gui *Gui) rerenderView(viewName string) error {
|
||||
|
||||
return context.HandleRender()
|
||||
}
|
||||
|
||||
func (gui *Gui) getCurrentSideView() *gocui.View {
|
||||
currentSideContext := gui.currentSideContext()
|
||||
if currentSideContext == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
view, _ := gui.g.View(currentSideContext.GetViewName())
|
||||
|
||||
return view
|
||||
}
|
||||
|
Reference in New Issue
Block a user