editor

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CommandNoOp = ":"

CommandNoOp is a special command that indicates that no editor should be launched and the text should be returned as-is. This behavior is copied from git's GIT_EDITOR. https://github.com/git/git/blob/5699ec1b0aec51b9e9ba5a2785f65970c5a95d84/editor.c#L57

Variables

This section is empty.

Functions

func DefaultCommand

func DefaultCommand(repo *git.Repo) string

func Launch

func Launch(repo *git.Repo, config Config) (string, error)

Types

type Config

type Config struct {
	// The text to be edited.
	// After the editor is closed, the contents will be written back to this field.
	Text string
	// The file pattern to use when creating the temporary file for the editor.
	TmpFilePattern string
	// The prefix used to identify comments in the text.
	CommentPrefix string
	// The editor command to be used.
	// If empty, the git default editor will be used.
	Command string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL