Documentation
¶
Index ¶
- Constants
- Variables
- func FindEditorBinary() string
- func NewPreambleReader(r libio.Reader) *io.PrefixScanner
- func PreambleLength(r libio.Reader) (int64, error)
- type Editor
- type EditorFunc
- type EditorOption
- func EditorArgs(args ...string) EditorOption
- func EditorEnv(vars ...string) EditorOption
- func EditorPrepare(cb EditorFunc) EditorOption
- func EditorRetry(cb func(error) bool) EditorOption
- func EditorSave(cb EditorFunc) EditorOption
- func EditorStdIn(r libio.Reader) EditorOption
- func EditorStdOut(w libio.Writer) EditorOption
- func EditorStdin(w libio.Writer) EditorOption
- func EditorUnchanged(cb EditorFunc) EditorOption
- type PreambleData
Constants ¶
View Source
const ( Prefix = "# |" PreambleTemplate = `` /* 744-byte string literal not displayed */ )
View Source
const EditorEnvVar = "EDITOR"
Variables ¶
View Source
var ( ErrNoEditorFound = errors.New("Unable to find editor") EditorPaths = []string{ "/usr/bin/sensible-editor", "/usr/bin/editor", "/usr/bin/vim", "/usr/bin/vi", } )
View Source
var TemplateFunctions template.FuncMap = template.FuncMap{
"join": join,
"decorate": decorate,
}
Functions ¶
func FindEditorBinary ¶
func FindEditorBinary() string
func NewPreambleReader ¶
func NewPreambleReader(r libio.Reader) *io.PrefixScanner
NewPreambleReader provides a io.Reader implementation which skips the preamble from the provided reader instance
Types ¶
type EditorFunc ¶
type EditorOption ¶
type EditorOption func(*Editor)
func EditorArgs ¶
func EditorArgs(args ...string) EditorOption
func EditorEnv ¶
func EditorEnv(vars ...string) EditorOption
func EditorPrepare ¶
func EditorPrepare(cb EditorFunc) EditorOption
func EditorRetry ¶
func EditorRetry(cb func(error) bool) EditorOption
func EditorSave ¶
func EditorSave(cb EditorFunc) EditorOption
func EditorStdIn ¶
func EditorStdIn(r libio.Reader) EditorOption
func EditorStdOut ¶
func EditorStdOut(w libio.Writer) EditorOption
func EditorStdin ¶
func EditorStdin(w libio.Writer) EditorOption
func EditorUnchanged ¶
func EditorUnchanged(cb EditorFunc) EditorOption
type PreambleData ¶
func NewPreambleData ¶
func NewPreambleData() *PreambleData
Click to show internal directories.
Click to hide internal directories.