@@ -37,15 +37,15 @@ func init() {
3737// EXTENDED to enable different prompting behavior
3838type GhEditor struct {
3939 * survey.Editor
40- EditorName string
40+ EditorCommand string
4141}
4242
43- func (e * GhEditor ) editorName () string {
44- if e .EditorName == "" {
43+ func (e * GhEditor ) editorCommand () string {
44+ if e .EditorCommand == "" {
4545 return defaultEditor
4646 }
4747
48- return e .EditorName
48+ return e .EditorCommand
4949}
5050
5151// EXTENDED to change prompt text
@@ -58,17 +58,17 @@ var EditorQuestionTemplate = `
5858{{- else }}
5959 {{- if and .Help (not .ShowHelp)}}{{color "cyan"}}[{{ .Config.HelpInput }} for help]{{color "reset"}} {{end}}
6060 {{- if and .Default (not .HideDefault)}}{{color "white"}}({{.Default}}) {{color "reset"}}{{end}}
61- {{- color "cyan"}}[(e) to launch {{ .EditorName }}, enter to skip] {{color "reset"}}
61+ {{- color "cyan"}}[(e) to launch {{ .EditorCommand }}, enter to skip] {{color "reset"}}
6262{{- end}}`
6363
6464// EXTENDED to pass editor name (to use in prompt)
6565type EditorTemplateData struct {
6666 survey.Editor
67- EditorName string
68- Answer string
69- ShowAnswer bool
70- ShowHelp bool
71- Config * survey.PromptConfig
67+ EditorCommand string
68+ Answer string
69+ ShowAnswer bool
70+ ShowHelp bool
71+ Config * survey.PromptConfig
7272}
7373
7474// EXTENDED to augment prompt text and keypress handling
@@ -77,9 +77,9 @@ func (e *GhEditor) prompt(initialValue string, config *survey.PromptConfig) (int
7777 EditorQuestionTemplate ,
7878 // EXTENDED to support printing editor in prompt
7979 EditorTemplateData {
80- Editor : * e .Editor ,
81- EditorName : filepath .Base (e .editorName ()),
82- Config : config ,
80+ Editor : * e .Editor ,
81+ EditorCommand : filepath .Base (e .editorCommand ()),
82+ Config : config ,
8383 },
8484 )
8585 if err != nil {
@@ -118,10 +118,10 @@ func (e *GhEditor) prompt(initialValue string, config *survey.PromptConfig) (int
118118 EditorQuestionTemplate ,
119119 EditorTemplateData {
120120 // EXTENDED to support printing editor in prompt
121- Editor : * e .Editor ,
122- EditorName : filepath .Base (e .editorName ()),
123- ShowHelp : true ,
124- Config : config ,
121+ Editor : * e .Editor ,
122+ EditorCommand : filepath .Base (e .editorCommand ()),
123+ ShowHelp : true ,
124+ Config : config ,
125125 },
126126 )
127127 if err != nil {
@@ -164,7 +164,7 @@ func (e *GhEditor) prompt(initialValue string, config *survey.PromptConfig) (int
164164
165165 stdio := e .Stdio ()
166166
167- args , err := shellquote .Split (e .editorName ())
167+ args , err := shellquote .Split (e .editorCommand ())
168168 if err != nil {
169169 return "" , err
170170 }
0 commit comments