components/wordnav
Labs · 64 / 64

WordNav

ui.widgets.Textarea

Wortweise Cursorbewegung über Schriftsysteme hinweg.

BEHAVIOR CONTRACT

Wortsprünge folgen den Unicode-Wortgrenzen über Griechisch, Kyrillisch und Emoji hinweg.

RECORDED INTERACTION

Der Harness bewegt sich mit ⌥← Wort für Wort.

examples/storybook/stories.zig:4575
pub fn buildWordNav(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
    const a = cx.allocator;
    const c = try col(cx, 12);
    try c.appendChild(a, try label(cx, "Word navigation — Alt+←/→ jumps whole Greek/Cyrillic words; double-click selects the word; family emoji is one cluster"));

    const ta = try W.Textarea(.{
        .label_text = "Mixed-script sample",
        .value = WORDNAV_TEXT,
        .rows = 3,
        .width = 560,
    }).mount(scope, cx);
    ta.meta.ownership.meta.test_id = "story.wordnav.ta";
    try c.appendChild(a, ta);

    try c.appendChild(a, try label(cx, "Expected Alt+Right stops (byte offsets): 7 14 27 34 40 46 72 75"));
    return c;
}
Quellcode auf GitHub ansehenexamples/storybook/stories.zig:4575

Der unveränderte Quellcode der Story aus dem Storybook (zenit 5f9add5+wip 2026-09-30). W steht für ui.widgets; col / row / label sind kleine Layout-Helfer des Storybooks.

zenit · DoppellizenzKostenlos für Open-Source-Projekte unter GPL-3.0-only; Closed-Source- oder kommerzielle Produkte benötigen eine kommerzielle Lizenz.Kontakt zum Autor: zongyi.xzy#gmail.com (# durch @ ersetzen)zenit 5f9add5+wip 2026-09-30