aboutsummaryrefslogtreecommitdiff
path: root/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
commit079eacb0f80b7b0d13b35544c382ac50fee9076d (patch)
tree272a50872348d0c60a9a794083ea8a2182676a0b /src/tui/text.cc
parent9bfcdbf2131ae6c08040226be6e92447db625b18 (diff)
downloadrwebbrowser-079eacb0f80b7b0d13b35544c382ac50fee9076d.tar.gz
rwebbrowser-079eacb0f80b7b0d13b35544c382ac50fee9076d.tar.xz
feat(tui): integrate address input and navigation requestsHEADmaster
Diffstat (limited to 'src/tui/text.cc')
-rw-r--r--src/tui/text.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tui/text.cc b/src/tui/text.cc
index 95b324b..ba24af2 100644
--- a/src/tui/text.cc
+++ b/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.