mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
Use GetPath accessor outside of filetree package
In preparation of making it private to the package.
This commit is contained in:
parent
2dfc3491bd
commit
53090b2c45
3 changed files with 6 additions and 6 deletions
|
@ -231,7 +231,7 @@ func (self *CommitFilesController) openCopyMenu() error {
|
|||
copyPathItem := &types.MenuItem{
|
||||
Label: self.c.Tr.CopyFilePath,
|
||||
OnPress: func() error {
|
||||
if err := self.c.OS().CopyToClipboard(node.Path); err != nil {
|
||||
if err := self.c.OS().CopyToClipboard(node.GetPath()); err != nil {
|
||||
return err
|
||||
}
|
||||
self.c.Toast(self.c.Tr.FilePathCopiedToast)
|
||||
|
|
|
@ -410,7 +410,7 @@ func (self *FilesController) pressWithLock(selectedNodes []*filetree.FileNode) e
|
|||
|
||||
toPaths := func(nodes []*filetree.FileNode) []string {
|
||||
return lo.Map(nodes, func(node *filetree.FileNode, _ int) string {
|
||||
return node.Path
|
||||
return node.GetPath()
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -881,7 +881,7 @@ func (self *FilesController) openDiffTool(node *filetree.FileNode) error {
|
|||
return self.c.RunSubprocessAndRefresh(
|
||||
self.c.Git().Diff.OpenDiffToolCmdObj(
|
||||
git_commands.DiffToolCmdOptions{
|
||||
Filepath: node.Path,
|
||||
Filepath: node.GetPath(),
|
||||
FromCommit: fromCommit,
|
||||
ToCommit: "",
|
||||
Reverse: reverse,
|
||||
|
@ -979,7 +979,7 @@ func (self *FilesController) openCopyMenu() error {
|
|||
copyPathItem := &types.MenuItem{
|
||||
Label: self.c.Tr.CopyFilePath,
|
||||
OnPress: func() error {
|
||||
if err := self.c.OS().CopyToClipboard(node.Path); err != nil {
|
||||
if err := self.c.OS().CopyToClipboard(node.GetPath()); err != nil {
|
||||
return err
|
||||
}
|
||||
self.c.Toast(self.c.Tr.FilePathCopiedToast)
|
||||
|
|
|
@ -293,7 +293,7 @@ func getColorForChangeStatus(changeStatus string) style.TextStyle {
|
|||
}
|
||||
|
||||
func fileNameAtDepth(node *filetree.Node[models.File], depth int) string {
|
||||
splitName := split(node.Path)
|
||||
splitName := split(node.GetPath())
|
||||
name := join(splitName[depth:])
|
||||
|
||||
if node.File != nil && node.File.IsRename() {
|
||||
|
@ -314,7 +314,7 @@ func fileNameAtDepth(node *filetree.Node[models.File], depth int) string {
|
|||
}
|
||||
|
||||
func commitFileNameAtDepth(node *filetree.Node[models.CommitFile], depth int) string {
|
||||
splitName := split(node.Path)
|
||||
splitName := split(node.GetPath())
|
||||
name := join(splitName[depth:])
|
||||
|
||||
return name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue