1
0
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:
Jesse Duffield
2022-03-26 14:44:30 +11:00
parent 13b90ac37f
commit ad7703df65
32 changed files with 766 additions and 649 deletions

View 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)
}