editor

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package editor edits issue text in the user's $EDITOR.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd(path string) *exec.Cmd

Cmd returns an exec.Cmd that opens path in the user's editor.

func Command

func Command() []string

Command returns the user's editor command: $VISUAL, $EDITOR, or the first of nano, vim, and vi that is installed.

func Parse

func Parse(doc string) (title, body string, ok bool)

Parse splits an edited document into title and body. ok is false when the document is empty, meaning the user cancelled.

func ReadAndRemove

func ReadAndRemove(path string) (string, error)

ReadAndRemove reads the edited file and deletes its temp directory.

func Run

func Run(doc string) (string, error)

Run edits doc in the user's editor, attached to the terminal, and returns the result.

func TempFile

func TempFile(doc string) (string, error)

TempFile writes doc to a new markdown file and returns its path.

func Template

func Template(title, body, help string) string

Template renders title and body as an editable document: the first line is the title and everything after the blank line is the body, like a commit message. help is appended as an HTML comment, which is stripped on parse.

Types

This section is empty.

Jump to

Keyboard shortcuts

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