lineedit

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package lineedit is the one-line text editor behind every text field of the UI. It depends on nothing in package ui, so components in their own packages can edit the shared line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Typed

func Typed(k tea.KeyPressMsg) string

Typed returns the printable text of a key press, if any.

Types

type Line

type Line struct {
	Buf []rune
	Pos int // the caret, an index into Buf
}

Line is the one-line text editor behind every text field: the entry typed into a cell (ENTER, EDIT), prompts on the context line, and the search fields of the find bar and the pickers. Only one of them is edited at a time, so they share it; a component with several fields keeps the others' text itself and loads a field here to edit it.

func (*Line) CanPoint

func (l *Line) CanPoint() bool

CanPoint reports whether the text before the caret ends where a cell reference may follow.

func (*Line) Clear

func (l *Line) Clear()

Clear empties the line.

func (*Line) Head

func (l *Line) Head() string

Head and tail are the text before and after the caret.

func (*Line) Insert

func (l *Line) Insert(text string)

Insert types text at the caret. Line breaks and tabs become spaces, and other control characters are dropped.

func (*Line) IsFormula

func (l *Line) IsFormula() bool

IsFormula reports whether the edit line holds a formula.

func (*Line) Key

func (l *Line) Key(k tea.KeyPressMsg)

Key applies a line-editing Key.

func (*Line) Set

func (l *Line) Set(text string)

Set replaces the text, with the caret at its end.

func (*Line) SetCaret

func (l *Line) SetCaret(x int)

SetCaret puts the edit caret at display column x of the entry.

func (*Line) Tail

func (l *Line) Tail() string

func (*Line) Text

func (l *Line) Text() string

Text is the whole line.

Jump to

Keyboard shortcuts

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