MCPcopy
hub / github.com/cli/cli / MarkdownEditor

Method MarkdownEditor

internal/prompter/huh_prompter.go:273–290  ·  view source on GitHub ↗
(prompt, defaultValue string, blankAllowed bool)

Source from the content-addressed store, hash-verified

271}
272
273func (p *huhPrompter) MarkdownEditor(prompt, defaultValue string, blankAllowed bool) (string, error) {
274 form, result := p.buildMarkdownEditorForm(prompt, blankAllowed)
275 err := p.runForm(form)
276 if err != nil {
277 return "", err
278 }
279
280 if *result == "skip" {
281 return "", nil
282 }
283
284 text, err := surveyext.Edit(p.editorCmd, "*.md", defaultValue, p.stdin, p.stdout, p.stderr)
285 if err != nil {
286 return "", err
287 }
288
289 return text, nil
290}

Callers

nothing calls this directly

Calls 3

runFormMethod · 0.95
EditFunction · 0.92

Tested by

no test coverage detected