diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-10-26 20:37:52 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-10-26 20:37:52 +0800 |
| commit | 2e6dc81391c5dbb787cfd793ad5823904b3b9c94 (patch) | |
| tree | 6c6de805790d75f1b3844d3d65c955f8ec832bf5 /ricochet/src/tui/text.cc | |
| parent | 2063bf09fa8828c602ca1726a1188f0c95ae8adb (diff) | |
| download | rcc-project-2e6dc81391c5dbb787cfd793ad5823904b3b9c94.tar.gz rcc-project-2e6dc81391c5dbb787cfd793ad5823904b3b9c94.tar.xz | |
feat(tui): add document navigation and text selection
Diffstat (limited to 'ricochet/src/tui/text.cc')
| -rw-r--r-- | ricochet/src/tui/text.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ricochet/src/tui/text.cc b/ricochet/src/tui/text.cc index 14f0e09..b2c64b8 100644 --- a/ricochet/src/tui/text.cc +++ b/ricochet/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 ) ); } |
