Documentation
¶
Overview ¶
Package fzfutil holds the text container used by fzfalgo. Compared with upstream it keeps the byte and rune views in two fields instead of one unsafe-reinterpreted slice, and drops everything the matcher does not use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MayFoldToASCII ¶
MayFoldToASCII reports whether case folding or normalization could turn r into an ASCII character.
Types ¶
type Chars ¶
type Chars struct {
// contains filtered or unexported fields
}
Chars is a line of text, kept as bytes when it is pure ASCII and as runes otherwise. The zero value is an empty ASCII text.
func ToChars ¶
ToChars converts a byte array into a Chars. Pure ASCII input is kept as is; anything else is decoded into runes, one utf8.RuneError per invalid byte.
func (*Chars) Bytes ¶
Bytes returns the underlying byte slice, or nil if the text is kept as runes. Read only.
func (*Chars) MayFoldToASCII ¶
MayFoldToASCII reports whether the text holds a rune that case folding or normalization could turn into an ASCII character. When false, an ASCII pattern character can only match the identical ASCII rune, which is what lets the prefilter scan the rune array directly.