Skip to content

Commit

Permalink
fixup! Rename "Custom Command" to "Shell Command"
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaller committed Aug 6, 2024
1 parent 10624f1 commit 08803bf
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions pkg/config/user_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ type KeybindingUniversalConfig struct {
ScrollDownMainAlt1 string `yaml:"scrollDownMain-alt1"`
ScrollUpMainAlt2 string `yaml:"scrollUpMain-alt2"`
ScrollDownMainAlt2 string `yaml:"scrollDownMain-alt2"`
ExecuteCustomCommand string `yaml:"executeCustomCommand"`
ExecuteShellCommand string `yaml:"executeCustomCommand"`
CreateRebaseOptionsMenu string `yaml:"createRebaseOptionsMenu"`
Push string `yaml:"pushFiles"` // 'Files' appended for legacy reasons
Pull string `yaml:"pullFiles"` // 'Files' appended for legacy reasons
Expand Down Expand Up @@ -824,7 +824,7 @@ func GetDefaultConfig() *UserConfig {
ScrollDownMainAlt1: "J",
ScrollUpMainAlt2: "<c-u>",
ScrollDownMainAlt2: "<c-d>",
ExecuteCustomCommand: ":",
ExecuteShellCommand: ":",
CreateRebaseOptionsMenu: "m",
Push: "P",
Pull: "p",
Expand Down
2 changes: 1 addition & 1 deletion pkg/gui/controllers/global_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewGlobalController(
func (self *GlobalController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
return []*types.Binding{
{
Key: opts.GetKey(opts.Config.Universal.ExecuteCustomCommand),
Key: opts.GetKey(opts.Config.Universal.ExecuteShellCommand),
Handler: self.shellCommand,
Description: self.c.Tr.ExecuteShellCommand,
Tooltip: self.c.Tr.ExecuteShellCommandTooltip,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var FilterUpdatesWhenModelChanges = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Files().Focus()

// To do that, we use a custom command to create a new branch that matches the filter
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
Type("git branch new-branch").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var BasicShellCommand = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Files().
IsEmpty().
IsFocused().
Press(keys.Universal.ExecuteCustomCommand)
Press(keys.Universal.ExecuteShellCommand)

t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var ComplexShellCommand = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Files().
IsEmpty().
IsFocused().
Press(keys.Universal.ExecuteCustomCommand)
Press(keys.Universal.ExecuteShellCommand)

t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
Expand Down
4 changes: 2 additions & 2 deletions pkg/integration/tests/shell_commands/delete_from_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var DeleteFromHistory = NewIntegrationTest(NewIntegrationTestArgs{
SetupConfig: func(cfg *config.AppConfig) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
createCustomCommand := func(command string) {
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
Type(command).
Expand All @@ -24,7 +24,7 @@ var DeleteFromHistory = NewIntegrationTest(NewIntegrationTestArgs{
createCustomCommand("echo 2")
createCustomCommand("echo 3")

t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
SuggestionLines(
Expand Down
4 changes: 2 additions & 2 deletions pkg/integration/tests/shell_commands/edit_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ var EditHistory = NewIntegrationTest(NewIntegrationTestArgs{
SetupRepo: func(shell *Shell) {},
SetupConfig: func(cfg *config.AppConfig) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
Type("echo x").
Confirm()

t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
Type("ec").
Expand Down
10 changes: 5 additions & 5 deletions pkg/integration/tests/shell_commands/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ var History = NewIntegrationTest(NewIntegrationTestArgs{
SetupRepo: func(shell *Shell) {},
SetupConfig: func(cfg *config.AppConfig) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
Type("echo 1").
Confirm()

t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
SuggestionLines(Contains("1")).
Type("echo 2").
Confirm()

t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
SuggestionLines(
Expand All @@ -36,7 +36,7 @@ var History = NewIntegrationTest(NewIntegrationTestArgs{
Type("echo 3").
Confirm()

t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
SuggestionLines(
Expand All @@ -48,7 +48,7 @@ var History = NewIntegrationTest(NewIntegrationTestArgs{
Confirm()

// Executing a command again should move it to the front:
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
SuggestionLines(
Expand Down
6 changes: 3 additions & 3 deletions pkg/integration/tests/shell_commands/omit_from_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ var OmitFromHistory = NewIntegrationTest(NewIntegrationTestArgs{
},
SetupConfig: func(cfg *config.AppConfig) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
Type("echo aubergine").
Confirm()

t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
SuggestionLines(Contains("aubergine")).
SuggestionLines(DoesNotContain("tangerine")).
Type(" echo tangerine").
Confirm()

t.GlobalPress(keys.Universal.ExecuteCustomCommand)
t.GlobalPress(keys.Universal.ExecuteShellCommand)
t.ExpectPopup().Prompt().
Title(Equals("Shell command:")).
SuggestionLines(Contains("aubergine")).
Expand Down

0 comments on commit 08803bf

Please sign in to comment.