1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

support viewing commits of reflog entry and show better view title

This commit is contained in:
Jesse Duffield
2022-03-24 22:07:30 +11:00
parent e039429885
commit 13b90ac37f
21 changed files with 177 additions and 54 deletions

View File

@ -1,10 +1,13 @@
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 {
@ -37,6 +40,7 @@ func NewCommitFilesContext(
Key: COMMIT_FILES_CONTEXT_KEY,
Kind: types.SIDE_CONTEXT,
Focusable: true,
Transient: true,
}),
ContextCallbackOpts{
OnFocus: onFocus,
@ -59,3 +63,7 @@ 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))
}