MCPcopy
hub / github.com/cli/cli / CommentableInteractiveEditSurvey

Function CommentableInteractiveEditSurvey

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

Source from the content-addressed store, hash-verified

312}
313
314func CommentableInteractiveEditSurvey(cf func() (gh.Config, error), io *iostreams.IOStreams) func(string) (string, error) {
315 return func(initialValue string) (string, error) {
316 editorCommand, err := cmdutil.DetermineEditor(cf)
317 if err != nil {
318 return "", err
319 }
320 cs := io.ColorScheme()
321 fmt.Fprintf(io.Out, "- %s to draft your comment in %s... ", cs.Bold("Press Enter"), cs.Bold(surveyext.EditorName(editorCommand)))
322 _ = waitForEnter(io.In)
323 return surveyext.Edit(editorCommand, "*.md", initialValue, io.In, io.Out, io.ErrOut)
324 }
325}
326
327func CommentableInteractiveCreateIfNoneSurvey(p Prompt) func() (bool, error) {
328 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