package
Version:
v1.8.1
Opens a new window with list of versions in this module.
Published: Aug 18, 2026
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package contextwindow parses directional line and character window specifications.
Extract returns the context selected by spec around matchIndex in raw.
Mode determines how a context window is interpreted.
const (
ModeNone Mode = iota
ModeCols
ModeBox
)
type Spec struct {
Mode Mode
ColsBefore int
ColsAfter int
LinesBefore int
LinesAfter int
}
Spec describes directional context boundaries around a match.
Parse parses the grammar shared by --match-context and component within fields.
IsZero reports whether no window is configured.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.