"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/surveyext/editor.go" between
gh-cli-1.11.0.tar.gz and gh-cli-1.12.0.tar.gz

About: GitHub CLI is GitHub’s official command line tool.

editor.go  (gh-cli-1.11.0):editor.go  (gh-cli-1.12.0)
skipping to change at line 38 skipping to change at line 38
} else if e := os.Getenv("EDITOR"); e != "" { } else if e := os.Getenv("EDITOR"); e != "" {
defaultEditor = e defaultEditor = e
} }
} }
// EXTENDED to enable different prompting behavior // EXTENDED to enable different prompting behavior
type GhEditor struct { type GhEditor struct {
*survey.Editor *survey.Editor
EditorCommand string EditorCommand string
BlankAllowed bool BlankAllowed bool
lookPath func(string) ([]string, []string, error)
} }
func (e *GhEditor) editorCommand() string { func (e *GhEditor) editorCommand() string {
if e.EditorCommand == "" { if e.EditorCommand == "" {
return defaultEditor return defaultEditor
} }
return e.EditorCommand return e.EditorCommand
} }
skipping to change at line 139 skipping to change at line 141
}, },
) )
if err != nil { if err != nil {
return "", err return "", err
} }
} }
continue continue
} }
stdio := e.Stdio() stdio := e.Stdio()
text, err := Edit(e.editorCommand(), e.FileName, initialValue, stdio.In, lookPath := e.lookPath
stdio.Out, stdio.Err, cursor) if lookPath == nil {
lookPath = defaultLookPath
}
text, err := edit(e.editorCommand(), e.FileName, initialValue, stdio.In,
stdio.Out, stdio.Err, cursor, lookPath)
if err != nil { if err != nil {
return "", err return "", err
} }
// check length, return default value on empty // check length, return default value on empty
if len(text) == 0 && !e.AppendDefault { if len(text) == 0 && !e.AppendDefault {
return e.Default, nil return e.Default, nil
} }
return text, nil return text, nil
 End of changes. 2 change blocks. 
2 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)