cursor

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cursor provides utilities for managing terminal cursor position in Bubbletea views using an invisible marker.

Index

Constants

View Source
const Marker = "\x1b]1337;marker\x07"

Marker is a special string that components can embed in their View() output to indicate where the cursor should be positioned. It renders as invisible.

Variables

This section is empty.

Functions

func Extract

func Extract(view string) (string, *tea.Cursor)

Extract finds the cursor marker in a view string, calculates its position, and returns the cleaned view (without marker) and the cursor position. Returns nil cursor if no marker is found.

func Insert

func Insert(view string, x, y int) string

Insert places the cursor marker at the given visible position (x, y) in a view string. Coordinates are in visible characters, not bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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