1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +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

@ -1,18 +1,16 @@
package context
import (
"fmt"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/gui/filetree"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
)
type CommitFilesContext struct {
*filetree.CommitFileTreeViewModel
*ListContextTrait
*DynamicTitleBuilder
}
var _ types.IListContext = (*CommitFilesContext)(nil)
@ -32,6 +30,7 @@ func NewCommitFilesContext(
return &CommitFilesContext{
CommitFileTreeViewModel: viewModel,
DynamicTitleBuilder: NewDynamicTitleBuilder(c.Tr.CommitFilesDynamicTitle),
ListContextTrait: &ListContextTrait{
Context: NewSimpleContext(
NewBaseContext(NewBaseContextOpts{
@ -63,7 +62,3 @@ func (self *CommitFilesContext) GetSelectedItemId() string {
return item.ID()
}
func (self *CommitFilesContext) Title() string {
return fmt.Sprintf(self.c.Tr.CommitFilesDynamicTitle, utils.TruncateWithEllipsis(self.GetRefName(), 50))
}