From cb1f404cc6b8b9dce135efd26fa32dc0d6fd79c4 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Mon, 26 Oct 2026 20:37:52 +0800 Subject: feat(tui): add document navigation and text selection --- src/tui/text.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tui/text.cc') diff --git a/src/tui/text.cc b/src/tui/text.cc index 14f0e09..b2c64b8 100644 --- a/src/tui/text.cc +++ b/src/tui/text.cc @@ -125,10 +125,13 @@ TextAnalysis TextService::analyze( std::string_view utf8, bool line_breaks, bool if ( glyph.word != WordKind::Space ) { if ( glyph.word == previous && glyph.word != WordKind::Ideograph ) { result.words.back().end = glyph.bytes.end; + result.graphemes.back().word_end = false; } else { result.words.push_back( glyph.bytes ); + glyph.word_start = true; } } + glyph.word_end = glyph.word != WordKind::Space; previous = glyph.word; result.graphemes.push_back( std::move( glyph ) ); } -- cgit v1.2.3