Skip to content

Commit 68a2a4c

Browse files
Merge pull request #2195 from jesseduffield/bumo-gocui
2 parents b0c19b2 + 8858f03 commit 68a2a4c

30 files changed

+225
-30
lines changed

docs/Custom_Command_Keybindings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ customCommands:
88
command: 'hub browse -- "commit/{{.SelectedLocalCommit.Sha}}"'
99
context: 'commits'
1010
- key: 'a'
11-
command: "git {{if .SelectedFile.HasUnstagedChanges}} add {{else}} reset {{end}} {{.SelectedFile.Name | Quote}}"
11+
command: "git {{if .SelectedFile.HasUnstagedChanges}} add {{else}} reset {{end}} {{.SelectedFile.Name | quote}}"
1212
context: 'files'
1313
description: 'toggle file staged'
1414
- key: 'C'

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/integrii/flaggy v1.4.0
1919
github.com/jesseduffield/generics v0.0.0-20220320043834-727e535cbe68
2020
github.com/jesseduffield/go-git/v5 v5.1.2-0.20201006095850-341962be15a4
21-
github.com/jesseduffield/gocui v0.3.1-0.20220922032454-744b0c465c37
21+
github.com/jesseduffield/gocui v0.3.1-0.20221001154429-72c39318a83d
2222
github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10
2323
github.com/jesseduffield/minimal/gitignore v0.3.3-0.20211018110810-9cde264e6b1e
2424
github.com/jesseduffield/yaml v2.1.0+incompatible
@@ -67,7 +67,7 @@ require (
6767
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 // indirect
6868
golang.org/x/exp v0.0.0-20220318154914-8dddf5d87bd8 // indirect
6969
golang.org/x/net v0.0.0-20201002202402-0a1ea396d57c // indirect
70-
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
70+
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
7171
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect
7272
golang.org/x/text v0.3.7 // indirect
7373
gopkg.in/warnings.v0 v0.1.2 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ github.com/jesseduffield/generics v0.0.0-20220320043834-727e535cbe68 h1:EQP2Tv8T
7272
github.com/jesseduffield/generics v0.0.0-20220320043834-727e535cbe68/go.mod h1:+LLj9/WUPAP8LqCchs7P+7X0R98HiFujVFANdNaxhGk=
7373
github.com/jesseduffield/go-git/v5 v5.1.2-0.20201006095850-341962be15a4 h1:GOQrmaE8i+KEdB8NzAegKYd4tPn/inM0I1uo0NXFerg=
7474
github.com/jesseduffield/go-git/v5 v5.1.2-0.20201006095850-341962be15a4/go.mod h1:nGNEErzf+NRznT+N2SWqmHnDnF9aLgANB1CUNEan09o=
75-
github.com/jesseduffield/gocui v0.3.1-0.20220922032454-744b0c465c37 h1:EE21YiOAGGs4/K8l3V15w5ICJmDrfwhklm3adc4N/8A=
76-
github.com/jesseduffield/gocui v0.3.1-0.20220922032454-744b0c465c37/go.mod h1:znJuCDnF2Ph40YZSlBwdX/4GEofnIoWLGdT4mK5zRAU=
75+
github.com/jesseduffield/gocui v0.3.1-0.20221001154429-72c39318a83d h1:OTUa2dO3IvnY53QWCABkKJK9v5yvs3+uv3RMbG698S0=
76+
github.com/jesseduffield/gocui v0.3.1-0.20221001154429-72c39318a83d/go.mod h1:znJuCDnF2Ph40YZSlBwdX/4GEofnIoWLGdT4mK5zRAU=
7777
github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10 h1:jmpr7KpX2+2GRiE91zTgfq49QvgiqB0nbmlwZ8UnOx0=
7878
github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10/go.mod h1:aA97kHeNA+sj2Hbki0pvLslmE4CbDyhBeSSTUUnOuVo=
7979
github.com/jesseduffield/minimal/gitignore v0.3.3-0.20211018110810-9cde264e6b1e h1:uw/oo+kg7t/oeMs6sqlAwr85ND/9cpO3up3VxphxY0U=
@@ -195,8 +195,8 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w
195195
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
196196
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
197197
golang.org/x/sys v0.0.0-20220318055525-2edf467146b5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
198-
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc=
199-
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
198+
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI=
199+
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
200200
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
201201
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 h1:tPwmk4vmvVCMdr98VgL4JH+qZxPL8fqlUOHnyOM8N3w=
202202
golang.org/x/term v0.0.0-20220919170432-7a66f970e087/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=

pkg/gui/services/custom_commands/handler_creator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (self *HandlerCreator) getResolveTemplateFn(form map[string]string, promptR
168168
}
169169

170170
funcs := template.FuncMap{
171-
"Quote": self.os.Quote,
171+
"quote": self.os.Quote,
172172
}
173173

174174
return func(templateStr string) (string, error) { return utils.ResolveTemplate(templateStr, objects, funcs) }

pkg/integration/tests/custom_commands/form_prompts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
1717
{
1818
Key: "a",
1919
Context: "files",
20-
Command: `echo {{.Form.FileContent | Quote}} > {{.Form.FileName | Quote}}`,
20+
Command: `echo {{.Form.FileContent | quote}} > {{.Form.FileName | quote}}`,
2121
Prompts: []config.CustomCommandPrompt{
2222
{
2323
Key: "FileName",

pkg/integration/tests/custom_commands/menu_from_command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ var MenuFromCommand = NewIntegrationTest(NewIntegrationTestArgs{
5555

5656
assert.InMenu()
5757
assert.MatchCurrentViewTitle(Equals("Choose commit message"))
58-
assert.MatchSelectedLine(Equals("baz"))
58+
assert.MatchSelectedLine(Equals("baz ")) // TODO: remove the trailing space
5959
input.NextItem()
60-
assert.MatchSelectedLine(Equals("bar"))
60+
assert.MatchSelectedLine(Equals("bar ")) // TODO: remove the trailing space
6161
input.Confirm()
6262

6363
assert.InPrompt()

vendor/github.com/jesseduffield/gocui/edit.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/jesseduffield/gocui/escape.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/jesseduffield/gocui/text_area.go

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/jesseduffield/gocui/view.go

Lines changed: 32 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)