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

Function CommentableInteractiveEditSurvey

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

Source from the content-addressed store, hash-verified

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