MCPcopy Create free account
hub / github.com/cli/cli / CommentableInteractiveEditSurvey

Function CommentableInteractiveEditSurvey

pkg/cmd/pr/shared/commentable.go:420–431  ·  view source on GitHub ↗
(cf func() (gh.Config, error), io *iostreams.IOStreams)

Source from the content-addressed store, hash-verified

418}
419
420func CommentableInteractiveEditSurvey(cf func() (gh.Config, error), io *iostreams.IOStreams) func(string) (string, error) {
421 return func(initialValue string) (string, error) {
422 editorCommand, err := cmdutil.DetermineEditor(cf)
423 if err != nil {
424 return "", err
425 }
426 cs := io.ColorScheme()
427 fmt.Fprintf(io.Out, "- %s to draft your comment in %s... ", cs.Bold("Press Enter"), cs.Bold(surveyext.EditorName(editorCommand)))
428 _ = waitForEnter(io.In)
429 return surveyext.Edit(editorCommand, "*.md", initialValue, io.In, io.Out, io.ErrOut)
430 }
431}
432
433func CommentableInteractiveCreateIfNoneSurvey(p Prompt) func() (bool, error) {
434 return func() (bool, error) {

Callers 1

NewCmdCommentFunction · 0.92

Calls 6

DetermineEditorFunction · 0.92
EditorNameFunction · 0.92
EditFunction · 0.92
ColorSchemeMethod · 0.80
BoldMethod · 0.80
waitForEnterFunction · 0.70

Tested by

no test coverage detected