editor

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor added in v0.1.0

type Editor struct {
	Command string
	Args    []string
	// contains filtered or unexported fields
}

func New added in v0.1.0

func New(command string, args []string, prefix, suffix string, length int) Editor

New returns an Editor configured to open files with `command` + `args`. The prefix and suffix will be added to the randomly generated filename of `length` characters.

func (*Editor) EditFile added in v0.1.0

func (e *Editor) EditFile(filename string) error

EditFile opens the specified file in the configured editor

func (*Editor) EditTempFile added in v0.1.0

func (e *Editor) EditTempFile(start string) ([]byte, error)

EditTempFile creates a temporary file with a random name, opens it in the editor, and returns the byte slice of its contents.

Jump to

Keyboard shortcuts

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