snippet

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 2 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 snippet cuts the stretch of text around a search hit that a result row shows. Both searches share it: the palette's Messages tab, reading a live session's transcript (internal/terminal), and the History tab, reading the conversation a parked session was indexed with (internal/store).

Index

Constants

View Source
const Width = 160

Width is how many runes of the matched text a row shows. Wide enough to recognise the sentence, short enough for one line at palette width.

Variables

This section is empty.

Functions

func Around

func Around(text, q string) (string, bool)

Around renders the stretch of text around the first mention of q as one palette line: whitespace collapsed (a message is prose with newlines and code in it), a window centred a little ahead of the match so the words leading into it stay visible, and an ellipsis on each side that was cut. false when the text does not mention q at all.

q is expected lowercased; the text is matched against it without regard to case.

Types

This section is empty.

Jump to

Keyboard shortcuts

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