mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-12 11:15:00 +02:00
24 lines
479 B
Go
24 lines
479 B
Go
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)
|
|
}
|