-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Add support for SetHighlightedFunc on TextView so a callback runs when the highlighted region changes. This enables region-based navigation (e.g. switching pages when the user selects a different region).
Background
Discovered while planning a tview presentation demo implementation via tviewyaml. The presentation info bar uses a TextView with regions for each slide; when the highlighted region changes, the app calls SwitchToPage to show that slide.
Demo Usage
Info bar needs to call SwitchToPage(highlightedRegion) when region changes.
Proposed Approach
- Add
onHighlighted(template expression) to TextView primitive config - In
builder/properties.go, callSetHighlightedFuncwhenonHighlightedis set - Pass added/removed/remaining region IDs to the template (via state or function args)
- Consider related: feat: support SetInputCapture per primitive #13 (presentation navigation model)
Relevant Files
config/types.go– addonHighlightedto TextView/Primitivebuilder/properties.go–applyTextViewPropertiestemplate/– executor support for region argsdocs/tview-coverage.md– document once implemented
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels