mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
genericise creating new branches off things
This commit is contained in:
parent
f858c8e750
commit
f63ec38aae
6 changed files with 71 additions and 75 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue