mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
show namesake for child views
This commit is contained in:
23
pkg/gui/context/dynamic_title_builder.go
Normal file
23
pkg/gui/context/dynamic_title_builder.go
Normal file
@ -0,0 +1,23 @@
|
||||
package context
|
||||
|
||||
import "fmt"
|
||||
|
||||
type DynamicTitleBuilder struct {
|
||||
formatStr string // e.g. 'remote branches for %s'
|
||||
|
||||
titleRef string // e.g. 'origin'
|
||||
}
|
||||
|
||||
func NewDynamicTitleBuilder(formatStr string) *DynamicTitleBuilder {
|
||||
return &DynamicTitleBuilder{
|
||||
formatStr: formatStr,
|
||||
}
|
||||
}
|
||||
|
||||
func (self *DynamicTitleBuilder) SetTitleRef(titleRef string) {
|
||||
self.titleRef = titleRef
|
||||
}
|
||||
|
||||
func (self *DynamicTitleBuilder) Title() string {
|
||||
return fmt.Sprintf(self.formatStr, self.titleRef)
|
||||
}
|
Reference in New Issue
Block a user