Selkie--Widget--TextInput--HighlightSpan

NAME

Selkie::Widget::TextInput::HighlightSpan - A styled character range within a TextInput buffer

SYNOPSIS

use Selkie::Widget::TextInput::HighlightSpan;
use Selkie::Style;

# Color characters 4..^10 of the buffer green:
my $span = Selkie::Widget::TextInput::HighlightSpan.new(
    start => 4,
    end   => 10,
    style => Selkie::Style.new(fg => 0x80E060),
);

DESCRIPTION

A simple value class — a half-open character range (start inclusive, end exclusive, both offsets into the input's buffer) plus the style to paint it with. Returned in lists from a TextInput.highlight-provider callback; the input repaints each range over its base text during render.

Unlike Selkie::Widget::RichText::Span, which carries its own text and flows within a paragraph, a HighlightSpan is positional: it references characters the buffer already owns. Ranges outside the visible window are clipped automatically; ranges that overlap paint in list order (later spans win).

Span styles should normally set fg only — the input merges each span onto its own base style, so an unset bg inherits the input's background and the highlight doesn't punch a hole in the field.

The class has its own file so that unit class can declare it without conflicting with Selkie::Widget::TextInput itself.

SEE ALSO

has UInt $.start

First character offset of the range (inclusive). Required.

has UInt $.end

One past the last character offset of the range (exclusive). Required.

has Selkie::Style $.style

Style painted over the range. Merged onto the input's base style, so set fg only unless you deliberately want a different background.

Selkie v0.10.0

High-level TUI framework built on Notcurses

Authors

  • Matt Doughty

License

Artistic-2.0

Dependencies

Notcurses::Native:ver<0.4.0+>:auth<zef:apogee>

Test Dependencies

Provides

  • Selkie
  • Selkie::App
  • Selkie::App::Internal::Dispatch
  • Selkie::App::Internal::ErrorLog
  • Selkie::App::Internal::FocusTree
  • Selkie::App::Internal::HitTest
  • Selkie::App::Internal::IdleBudget
  • Selkie::App::Internal::OverlayTree
  • Selkie::App::Internal::RenderLoop
  • Selkie::App::Internal::ScreenModalLifecycle
  • Selkie::App::Internal::Terminal
  • Selkie::App::Internal::TerminalSequences
  • Selkie::Container
  • Selkie::EffectiveBounds
  • Selkie::Event
  • Selkie::Layout::Allocate
  • Selkie::Layout::HBox
  • Selkie::Layout::Split
  • Selkie::Layout::VBox
  • Selkie::Plot::Palette
  • Selkie::Plot::Scaler
  • Selkie::Plot::Ticks
  • Selkie::ScreenManager
  • Selkie::Sizing
  • Selkie::Store
  • Selkie::Style
  • Selkie::Test::Focus
  • Selkie::Test::Keys
  • Selkie::Test::Snapshot
  • Selkie::Test::Snapshot::Harness
  • Selkie::Test::Store
  • Selkie::Test::Supply
  • Selkie::Test::Tree
  • Selkie::Theme
  • Selkie::Trace
  • Selkie::Tree
  • Selkie::Widget
  • Selkie::Widget::Axis
  • Selkie::Widget::BarChart
  • Selkie::Widget::Border
  • Selkie::Widget::Button
  • Selkie::Widget::CardList
  • Selkie::Widget::Checkbox
  • Selkie::Widget::CommandPalette
  • Selkie::Widget::ConfirmModal
  • Selkie::Widget::FileBrowser
  • Selkie::Widget::FocusableByDefault
  • Selkie::Widget::Heatmap
  • Selkie::Widget::HelpOverlay
  • Selkie::Widget::Histogram
  • Selkie::Widget::Image
  • Selkie::Widget::Legend
  • Selkie::Widget::LineChart
  • Selkie::Widget::ListView
  • Selkie::Widget::Modal
  • Selkie::Widget::MultiLineInput
  • Selkie::Widget::PasswordStrength
  • Selkie::Widget::Plot
  • Selkie::Widget::ProgressBar
  • Selkie::Widget::RadioGroup
  • Selkie::Widget::RichText
  • Selkie::Widget::RichText::Span
  • Selkie::Widget::ScatterPlot
  • Selkie::Widget::ScrollView
  • Selkie::Widget::Select
  • Selkie::Widget::Sparkline
  • Selkie::Widget::Spinner
  • Selkie::Widget::TabBar
  • Selkie::Widget::Table
  • Selkie::Widget::Text
  • Selkie::Widget::TextInput
  • Selkie::Widget::TextInput::HighlightSpan
  • Selkie::Widget::TextStream
  • Selkie::Widget::Toast
  • Selkie::Widget::ViewportedCardList

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.