Skip to content

Commit b8cd094

Browse files
andyfellerBagToad
andcommitted
Ensure markdown confirm prompt shows editor name
Apparently, `gh` might not actually have an editor at the time we're prompting the user if they want to use it for markdown editing. In the survey package, there is a function that will handle fallback to the default editor based on environment variables and parse it in the case the editor contains flags and arguments for cases like Visual Studio Code. Additionally, there are no tests for the EditorName function and the fact it is loaded via `init` makes this difficult to test. Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
1 parent 20ff409 commit b8cd094

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/prompter/prompter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ func (p *accessiblePrompter) InputHostname() (string, error) {
234234
func (p *accessiblePrompter) MarkdownEditor(prompt, defaultValue string, blankAllowed bool) (string, error) {
235235
var result string
236236
skipOption := "skip"
237-
openOption := "open"
237+
launchOption := "launch"
238238
options := []huh.Option[string]{
239-
huh.NewOption(fmt.Sprintf("Open Editor: %s", p.editorCmd), openOption),
239+
huh.NewOption(fmt.Sprintf("Launch %s", surveyext.EditorName(p.editorCmd)), launchOption),
240240
}
241241
if blankAllowed {
242242
options = append(options, huh.NewOption("Skip", skipOption))

0 commit comments

Comments
 (0)