From 9da3ff2bf923e846747bb45dca0d1158fa6331a1 Mon Sep 17 00:00:00 2001 From: BDisp Date: Fri, 22 May 2026 23:49:03 +0100 Subject: [PATCH 1/2] Fix TextAlignmentAndDirection scenario --- Directory.Packages.props | 2 +- .../Scenarios/TextAlignmentAndDirection.cs | 36 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2728da34da..006e45297a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -26,7 +26,7 @@ - + diff --git a/Examples/UICatalog/Scenarios/TextAlignmentAndDirection.cs b/Examples/UICatalog/Scenarios/TextAlignmentAndDirection.cs index a4326f1575..db6b5b987e 100644 --- a/Examples/UICatalog/Scenarios/TextAlignmentAndDirection.cs +++ b/Examples/UICatalog/Scenarios/TextAlignmentAndDirection.cs @@ -423,21 +423,27 @@ public override void Main () Text = "Edit Text:" }; - Editor editText = new () { X = Pos.Right (label) + 1, Y = Pos.Top (label), Width = Dim.Fill (31), Height = 3 }; - editText.Text = txt; - - window.KeyDown += (_, _) => - { - foreach (View v in singleLineLabels) - { - v.Text = editText.Text; - } - - foreach (View v in multiLineLabels) - { - v.Text = editText.Text; - } - }; + Editor editText = new () + { + X = Pos.Right (label) + 1, + Y = Pos.Top (label), + Width = Dim.Fill (31), + Height = 3, + Text = txt + }; + + editText.Document?.Changed += (_, _) => + { + foreach (View v in singleLineLabels) + { + v.Text = editText.Text; + } + + foreach (View v in multiLineLabels) + { + v.Text = editText.Text; + } + }; editText.SetFocus (); From efc3070172bef7726396a7d3ce328b22dc43a3df Mon Sep 17 00:00:00 2001 From: BDisp Date: Sat, 23 May 2026 01:46:41 +0100 Subject: [PATCH 2/2] Add a surrogate pair and a ZWJ emoji --- Examples/UICatalog/Scenarios/TextAlignmentAndDirection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/UICatalog/Scenarios/TextAlignmentAndDirection.cs b/Examples/UICatalog/Scenarios/TextAlignmentAndDirection.cs index db6b5b987e..9b41f04a26 100644 --- a/Examples/UICatalog/Scenarios/TextAlignmentAndDirection.cs +++ b/Examples/UICatalog/Scenarios/TextAlignmentAndDirection.cs @@ -16,7 +16,7 @@ public override void Main () using Window window = new () { Title = GetQuitKeyAndName () }; - var txt = $"Hello World{Environment.NewLine}HELLO WORLD{Environment.NewLine}?? ??"; + var txt = $"Hello World{Environment.NewLine}HELLO WORLD{Environment.NewLine}🦮 👨‍👩‍👧"; SchemeManager.AddScheme ("TextAlignmentAndDirection1", new Scheme { Normal = new Attribute (Color.Black, Color.Gray) }); SchemeManager.AddScheme ("TextAlignmentAndDirection2", new Scheme { Normal = new Attribute (Color.Black, Color.DarkGray) });