diff options
author | sportshead <32637656+sportshead@users.noreply.github.com> | 2022-07-29 14:12:36 +0800 |
---|---|---|
committer | sportshead <32637656+sportshead@users.noreply.github.com> | 2022-07-31 12:04:40 +0800 |
commit | f2880ecb463e9165977edcbee19e3013f56fc005 (patch) | |
tree | fb86c4f814ab848ad305e128c9ca172e3e9a91f5 /pkg/gui | |
parent | 168fbe0a6c25390a6982536254cfb0ff68a06b4a (diff) |
Add empty output message and refreshing to showOutput
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/services/custom_commands/handler_creator.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/gui/services/custom_commands/handler_creator.go b/pkg/gui/services/custom_commands/handler_creator.go index b5c2b9efd..6ac9fb733 100644 --- a/pkg/gui/services/custom_commands/handler_creator.go +++ b/pkg/gui/services/custom_commands/handler_creator.go @@ -1,6 +1,8 @@ package custom_commands import ( + "strings" + "github.com/jesseduffield/generics/slices" "github.com/jesseduffield/lazygit/pkg/commands" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" @@ -191,8 +193,15 @@ func (self *HandlerCreator) finalHandler(customCommand config.CustomCommand, ses if err != nil { return self.c.Error(err) } + if customCommand.ShowOutput { - return self.c.Alert(cmdStr, output) + if strings.TrimSpace(output) == "" { + output = self.c.Tr.EmptyOutput + } + if err = self.c.Alert(cmdStr, output); err != nil { + return self.c.Error(err) + } + return self.c.Refresh(types.RefreshOptions{}) } return self.c.Refresh(types.RefreshOptions{}) }) |