editor

package
v2.0.200+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package editor provides utilities for editing and re-editing text files in an editor until the changes are accepted or the user aborts the attempt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditRetryLoop

func EditRetryLoop(prefix string, selectFn func() io.Reader, applyFn func(b []byte) error) error

EditRetryLoop seeds a temp file, prefixed with |prefix|, with content from selectFn and passes it to applyFn. If applyFn errors, the editor will be re-opened with recent error message included in the header comments. The current implementation prefixes comment lines with "#".

Types

This section is empty.

Jump to

Keyboard shortcuts

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