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

Add "Absolute path" item to the file view's copy menu

Rename the existing item to "Relative path".
This commit is contained in:
Stefan Haller
2025-03-21 08:25:12 +01:00
parent 200e490398
commit a8f6b04ff3
5 changed files with 74 additions and 11 deletions

View File

@ -1,6 +1,8 @@
package diff
import (
"os"
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
@ -63,7 +65,7 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Path")).
Select(Contains("Relative path")).
Confirm().
Tap(func() {
t.ExpectToast(Equals("File path copied to clipboard"))
@ -71,6 +73,19 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
})
}).
Press(keys.Files.CopyFileInfoToClipboard).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Absolute path")).
Confirm().
Tap(func() {
t.ExpectToast(Equals("File path copied to clipboard"))
repoDir, _ := os.Getwd()
// On windows the following path would have backslashes, but we don't run integration tests on windows yet.
expectClipboard(t, Equals(repoDir+"/dir/file1"))
})
}).
Press(keys.Files.CopyFileInfoToClipboard).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).