summaryrefslogtreecommitdiffstats
path: root/pkg/gui/files_panel.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r--pkg/gui/files_panel.go25
1 files changed, 20 insertions, 5 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index 41ac25fb8..0f9bbd65d 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -659,8 +659,9 @@ func (gui *Gui) handlePullFiles() error {
}
return gui.prompt(promptOpts{
- title: gui.Tr.EnterUpstream,
- initialContent: "origin/" + currentBranch.Name,
+ title: gui.Tr.EnterUpstream,
+ initialContent: "origin/" + currentBranch.Name,
+ findSuggestionsFunc: gui.getRemoteBranchesSuggestionsFunc("/"),
handleConfirm: func(upstream string) error {
if err := gui.GitCommand.SetUpstreamBranch(upstream); err != nil {
errorMessage := err.Error()
@@ -798,8 +799,9 @@ func (gui *Gui) pushFiles() error {
return gui.push(pushOpts{setUpstream: true})
} else {
return gui.prompt(promptOpts{
- title: gui.Tr.EnterUpstream,
- initialContent: "origin " + currentBranch.Name,
+ title: gui.Tr.EnterUpstream,
+ initialContent: "origin " + currentBranch.Name,
+ findSuggestionsFunc: gui.getRemoteBranchesSuggestionsFunc(" "),
handleConfirm: func(upstream string) error {
var upstreamBranch, upstreamRemote string
split := strings.Split(upstream, " ")
@@ -884,8 +886,21 @@ func (gui *Gui) anyFilesWithMergeConflicts() bool {
func (gui *Gui) handleCustomCommand() error {
return gui.prompt(promptOpts{
- title: gui.Tr.CustomCommand,
+ title: gui.Tr.CustomCommand,
+ findSuggestionsFunc: gui.getCustomCommandsHistorySuggestionsFunc(),
handleConfirm: func(command string) error {
+ gui.Config.GetAppState().CustomCommandsHistory = utils.Limit(
+ utils.Uniq(
+ append(gui.Config.GetAppState().CustomCommandsHistory, command),
+ ),
+ 1000,
+ )
+
+ err := gui.Config.SaveAppState()
+ if err != nil {
+ gui.Log.Error(err)
+ }
+
gui.OnRunCommand(oscommands.NewCmdLogEntry(command, gui.Tr.Spans.CustomCommand, true))
return gui.runSubprocessWithSuspenseAndRefresh(
gui.OSCommand.PrepareShellSubProcess(command),