aboutsummaryrefslogtreecommitdiff
path: root/ricochet/src/tui/text.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-10-26 23:25:13 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-10-26 23:25:13 +0800
commitbdefdb301db843e87aee8c6c35808d295bb66ee5 (patch)
tree7a1658ca487b8eabe9517d4cfd8ace6d5b499f85 /ricochet/src/tui/text.cc
parente138e537bfb18a48391a973723940eec544dd8e1 (diff)
downloadrcc-project-bdefdb301db843e87aee8c6c35808d295bb66ee5.tar.gz
rcc-project-bdefdb301db843e87aee8c6c35808d295bb66ee5.tar.xz
feat(tui): integrate address input and navigation requests
Diffstat (limited to 'ricochet/src/tui/text.cc')
-rw-r--r--ricochet/src/tui/text.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/ricochet/src/tui/text.cc b/ricochet/src/tui/text.cc
index 95b324b..ba24af2 100644
--- a/ricochet/src/tui/text.cc
+++ b/ricochet/src/tui/text.cc
@@ -113,6 +113,7 @@ TextAnalysis TextService::analyze( std::string_view utf8, bool line_breaks, bool
.break_after = line_end == end };
utext_setNativeIndex( text.get(), begin );
const auto first = utext_next32( text.get() );
+ result.whitespace_only = result.whitespace_only && u_isUWhiteSpace( first );
glyph.word = word_kind( first );
const auto source = utf8.substr( glyph.bytes.start, glyph.bytes.end - glyph.bytes.start );
if ( line_breaks && ( source == "\n" || source == "\r\n" ) ) {
@@ -128,6 +129,7 @@ TextAnalysis TextService::analyze( std::string_view utf8, bool line_breaks, bool
&& !u_hasBinaryProperty( first, UCHAR_EMOJI_PRESENTATION );
while ( utext_getNativeIndex( text.get() ) < end ) {
const auto codepoint = utext_next32( text.get() );
+ result.whitespace_only = result.whitespace_only && u_isUWhiteSpace( codepoint );
glyph.display.push_back( static_cast<wchar_t>( codepoint ) );
// ncurses accepts one spacing character followed by nonspacing marks.
// Joiners, selectors and extra spacing characters use one visible fallback.