aboutsummaryrefslogtreecommitdiff
path: root/src/tui/text.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-10-26 20:37:52 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-10-26 20:37:52 +0800
commitcb1f404cc6b8b9dce135efd26fa32dc0d6fd79c4 (patch)
tree70fea121bc8c6fac3287c7a96fb8f5f86ec6f2e7 /src/tui/text.cc
parent795126a90d651ede075e9a94741dae4841e4de62 (diff)
downloadrwebbrowser-cb1f404cc6b8b9dce135efd26fa32dc0d6fd79c4.tar.gz
rwebbrowser-cb1f404cc6b8b9dce135efd26fa32dc0d6fd79c4.tar.xz
feat(tui): add document navigation and text selection
Diffstat (limited to 'src/tui/text.cc')
-rw-r--r--src/tui/text.cc3
1 files changed, 3 insertions, 0 deletions
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 ) );
}