diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-27 09:21:20 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-27 09:49:30 +1000 |
commit | 7cd17d3a73e31c6f7ab7aac69b77fbd1775d4ee5 (patch) | |
tree | a6beb39839541e8051d20444780ac154fb97bed4 /pkg/gui | |
parent | 8a59a4404b85ed380111b9f07505ea4d3b2aaa12 (diff) |
support custom command loading text
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/custom_commands.go | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go index 391245578..bf1e97b02 100644 --- a/pkg/gui/custom_commands.go +++ b/pkg/gui/custom_commands.go @@ -72,7 +72,11 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand CustomCommand) func( return nil } - return gui.WithWaitingStatus(gui.Tr.SLocalize("runningCustomCommandStatus"), func() error { + loadingText := customCommand.LoadingText + if loadingText == "" { + loadingText = gui.Tr.SLocalize("runningCustomCommandStatus") + } + return gui.WithWaitingStatus(loadingText, func() error { gui.OSCommand.PrepareSubProcess(cmdStr) if err := gui.OSCommand.RunCommand(cmdStr); err != nil { @@ -188,11 +192,12 @@ type CustomCommandPrompt struct { } type CustomCommand struct { - Key string `yaml:"key"` - Context string `yaml:"context"` - Command string `yaml:"command"` - Subprocess bool `yaml:"subprocess"` - Prompts []CustomCommandPrompt `yaml:"prompts"` + Key string `yaml:"key"` + Context string `yaml:"context"` + Command string `yaml:"command"` + Subprocess bool `yaml:"subprocess"` + Prompts []CustomCommandPrompt `yaml:"prompts"` + LoadingText string `yaml:"loadingText"` } func (gui *Gui) GetCustomCommandKeybindings() []*Binding { |