edit

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 28 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 edit is the terminal UI's config editing (design/tui.md "Forms and dialogs"): `:config` runs the user's editor on the config text and saves it through the API with its revision, and the server, new server and settings forms are overlays over a dimmed screen. Everything goes through the daemon's API, so it works with --on, and the daemon validates: its errors are shown under the fields they name.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor

type Editor struct {
	// contains filtered or unexported fields
}

Editor is the root model's handle on config editing: at most one overlay (a loading line, the proposals or a form) and the `:config` run.

func (*Editor) Config

func (e *Editor) Config(env *ui.Env, gen int) tea.Cmd

Config starts `:config`: the config text and revision come from the daemon (so it works with --on too), the user's editor runs on a private copy, and the result goes back with the original revision. The file on disk is never edited here. A new run replaces one whose dialog was cancelled. gen is the root's session generation.

func (*Editor) EditServer

func (e *Editor) EditServer(env *ui.Env, name string) tea.Cmd

EditServer opens the form of a server's config entry.

func (*Editor) Hints

func (e *Editor) Hints() [][2]string

Hints are the footer's key hints while the overlay is open: none for the form and the proposals picker, which draw theirs in their box, and the way out while the overlay loads.

func (*Editor) Key

func (e *Editor) Key(env *ui.Env, msg tea.KeyPressMsg) tea.Cmd

Key handles a key press while the overlay is open.

func (*Editor) Mouse

func (e *Editor) Mouse(env *ui.Env, msg tea.MouseMsg) tea.Cmd

Mouse handles the mouse while the overlay is open: a click on a field or a proposal selects it (a second click on a proposal opens it), the wheel moves the cursor.

func (*Editor) NewServer

func (e *Editor) NewServer(env *ui.Env, root string) tea.Cmd

NewServer opens the scan proposals of root ("" for the projects folder), from which a form opens prefilled or empty.

func (*Editor) Open

func (e *Editor) Open() bool

Open reports whether the editor's overlay is on screen and takes the keys.

func (*Editor) Settings

func (e *Editor) Settings(env *ui.Env) tea.Cmd

Settings opens the form of the top-level settings.

func (*Editor) Update

func (e *Editor) Update(env *ui.Env, msg tea.Msg) (tea.Cmd, bool)

Update handles the editor's own messages and pasted text while a form field is edited; false for any other message.

func (*Editor) View

func (e *Editor) View(env *ui.Env, screen string, w, h int) string

View draws the overlay centered over the screen (the root dims it) and keeps the box's place for clicks.

Jump to

Keyboard shortcuts

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