editor

package
v2.16.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 8 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureInputFromEditor

func CaptureInputFromEditor(resolveEditor PreferredEditorResolver, text, extension string) ([]byte, error)

CaptureInputFromEditor opens a temporary file in a text editor and returns the written bytes on success or an error on failure. It handles deletion of the temporary file behind the scenes.

func GetPreferredEditorFromEnvironment

func GetPreferredEditorFromEnvironment() ([]string, bool)

GetPreferredEditorFromEnvironment returns the user's editor as defined by the `$EDITOR` environment variable, or the `DefaultEditor` if it is not set.

func OpenFileInEditor

func OpenFileInEditor(filename string, resolveEditor PreferredEditorResolver) error

OpenFileInEditor opens filename in a text editor.

Types

type PreferredEditorResolver

type PreferredEditorResolver func() ([]string, bool)

PreferredEditorResolver is a function that returns an editor that the user prefers to use, such as the configured `$EDITOR` environment variable.

Jump to

Keyboard shortcuts

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