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 ¶
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 ¶
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.