mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-23 12:18:51 +02:00
For custom commands it is useful to select an earlier command and have it copied to the prompt for further editing. This can be done by hitting 'e' now. For other types of suggestion panels we don't enable this behavior, as you can't create arbitrary new items there that don't already exist as a suggestion.
32 lines
876 B
Go
32 lines
876 B
Go
package custom_commands
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var EditHistory = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Edit an entry from the custom commands history",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupRepo: func(shell *Shell) {},
|
|
SetupConfig: func(cfg *config.AppConfig) {},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
|
|
t.ExpectPopup().Prompt().
|
|
Title(Equals("Custom command:")).
|
|
Type("echo x").
|
|
Confirm()
|
|
|
|
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
|
|
t.ExpectPopup().Prompt().
|
|
Title(Equals("Custom command:")).
|
|
Type("ec").
|
|
SuggestionLines(
|
|
Equals("echo x"),
|
|
).
|
|
EditSuggestion(Equals("echo x")).
|
|
InitialText(Equals("echo x"))
|
|
},
|
|
})
|