editorname

package
v1.53.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package editorname maps the user's configured external editor (VISUAL or EDITOR) to a friendly display name used in TUI key-binding hints.

The lookup is intentionally a pure function so that it is trivial to test across platforms and editor configurations without touching the actual process environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromEnv

func FromEnv(visual, editorEnv string) string

FromEnv returns a friendly display name for the configured external editor. It reads VISUAL first, then falls back to EDITOR. When neither is set, it returns the platform-specific fallback ("Notepad" on Windows, "Vi" elsewhere) that matches the actual command that will be launched.

FromEnv is pure: it takes the raw environment values as parameters so that tests can exercise every code path without mutating os.Environ.

Types

This section is empty.

Jump to

Keyboard shortcuts

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