mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Use GetPath accessor outside of filetree package
In preparation of making it private to the package.
This commit is contained in:
@ -231,7 +231,7 @@ func (self *CommitFilesController) openCopyMenu() error {
|
|||||||
copyPathItem := &types.MenuItem{
|
copyPathItem := &types.MenuItem{
|
||||||
Label: self.c.Tr.CopyFilePath,
|
Label: self.c.Tr.CopyFilePath,
|
||||||
OnPress: func() error {
|
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
|
return err
|
||||||
}
|
}
|
||||||
self.c.Toast(self.c.Tr.FilePathCopiedToast)
|
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 {
|
toPaths := func(nodes []*filetree.FileNode) []string {
|
||||||
return lo.Map(nodes, func(node *filetree.FileNode, _ int) 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(
|
return self.c.RunSubprocessAndRefresh(
|
||||||
self.c.Git().Diff.OpenDiffToolCmdObj(
|
self.c.Git().Diff.OpenDiffToolCmdObj(
|
||||||
git_commands.DiffToolCmdOptions{
|
git_commands.DiffToolCmdOptions{
|
||||||
Filepath: node.Path,
|
Filepath: node.GetPath(),
|
||||||
FromCommit: fromCommit,
|
FromCommit: fromCommit,
|
||||||
ToCommit: "",
|
ToCommit: "",
|
||||||
Reverse: reverse,
|
Reverse: reverse,
|
||||||
@ -979,7 +979,7 @@ func (self *FilesController) openCopyMenu() error {
|
|||||||
copyPathItem := &types.MenuItem{
|
copyPathItem := &types.MenuItem{
|
||||||
Label: self.c.Tr.CopyFilePath,
|
Label: self.c.Tr.CopyFilePath,
|
||||||
OnPress: func() error {
|
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
|
return err
|
||||||
}
|
}
|
||||||
self.c.Toast(self.c.Tr.FilePathCopiedToast)
|
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 {
|
func fileNameAtDepth(node *filetree.Node[models.File], depth int) string {
|
||||||
splitName := split(node.Path)
|
splitName := split(node.GetPath())
|
||||||
name := join(splitName[depth:])
|
name := join(splitName[depth:])
|
||||||
|
|
||||||
if node.File != nil && node.File.IsRename() {
|
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 {
|
func commitFileNameAtDepth(node *filetree.Node[models.CommitFile], depth int) string {
|
||||||
splitName := split(node.Path)
|
splitName := split(node.GetPath())
|
||||||
name := join(splitName[depth:])
|
name := join(splitName[depth:])
|
||||||
|
|
||||||
return name
|
return name
|
||||||
|
Reference in New Issue
Block a user