editor

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package editor resolves the command that opens a path in the user's editor, shared by the dashboard's "open in editor" links and the `lerd code` command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(file string, line int) []string

Command resolves the argv to open file at line. A configured `editor` template wins (with {file}/{line} substitution, or the file appended when it has neither placeholder); otherwise the first GUI editor found on PATH is used, falling back to the platform opener.

func DirCommand

func DirCommand(dir string) []string

DirCommand resolves the argv to open a directory, the project-shaped variant of Command. A configured template is reused with {file} as the directory and {line} dropped, since a directory has no line to jump to. There is no platform-opener fallback: xdg-open would hand the directory to the file manager rather than an editor, so nil means "no editor found" and the caller should say so.

Types

This section is empty.

Jump to

Keyboard shortcuts

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