From 3c2afe269be361806fa2b28477aacda14e3a252f Mon Sep 17 00:00:00 2001 From: mdgrs <81177095+mdgrs-mei@users.noreply.github.com> Date: Sat, 3 Jan 2026 21:07:58 +0900 Subject: [PATCH 1/8] Add comments for low priority escape sequences --- src/PowerShellRun/UI/Canvas.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PowerShellRun/UI/Canvas.cs b/src/PowerShellRun/UI/Canvas.cs index e6d40a1..a17dfcb 100644 --- a/src/PowerShellRun/UI/Canvas.cs +++ b/src/PowerShellRun/UI/Canvas.cs @@ -303,6 +303,8 @@ public void Write() shouldSetEscapeSequence = true; } + // Low priority escape sequence is applied here before color and style settings. + // e.g. Escape sequences for highlighted characters. The highlight color setting is stronger. if (escapeSequence is not null && shouldSetEscapeSequence && escapeSequenceLowPriority) { builder.Append(escapeSequence); @@ -337,6 +339,8 @@ public void Write() builder.Append(FontStyleTable.GetEscapeCode(cell.FontStyle)); } + // Normal priority escape sequence is applied here after color and style settings. + // It is higher priority than color and style settings. if (escapeSequence is not null && shouldSetEscapeSequence && !escapeSequenceLowPriority) { builder.Append(escapeSequence); From 1d3fe6f425526719075273c5de6b830530c9d33e Mon Sep 17 00:00:00 2001 From: mdgrs <81177095+mdgrs-mei@users.noreply.github.com> Date: Sat, 3 Jan 2026 22:15:24 +0900 Subject: [PATCH 2/8] Refactor text element parsing with TextElementEnumerator --- src/PowerShellRun/UI/TextBox.cs | 222 ++++++++++++++++++++------------ 1 file changed, 143 insertions(+), 79 deletions(-) diff --git a/src/PowerShellRun/UI/TextBox.cs b/src/PowerShellRun/UI/TextBox.cs index dc1d912..b2c0583 100644 --- a/src/PowerShellRun/UI/TextBox.cs +++ b/src/PowerShellRun/UI/TextBox.cs @@ -1,9 +1,11 @@ namespace PowerShellRun; + using PowerShellRun.Dependency; using System; using System.Collections.Generic; using System.Diagnostics; using System.Management.Automation.Language; +using System.Reflection.PortableExecutable; using System.Text; internal class TextBox : LayoutItem @@ -163,40 +165,22 @@ void SetCell(Word word, int charIndex, char character = '\0', string? textElemen if (cellIndex >= maxWidth) break; - bool escaped = false; - var textElementIndexes = System.Globalization.StringInfo.ParseCombiningCharacters(word.String); - for (int i = 0; i < textElementIndexes.Length; ++i) + var textElement = new TextElementEnumerator(word.String); + while (textElement.MoveNext()) { if (cellIndex >= maxWidth) break; - var elementStartIndex = textElementIndexes[i]; - var elementStartIndexNext = (i + 1 == textElementIndexes.Length) ? word.String.Length : textElementIndexes[i + 1]; - - var elementCharCount = elementStartIndexNext - elementStartIndex; - bool isBaseCharacter = elementCharCount == 1; - var charIndex = elementStartIndex; - - if (isBaseCharacter) + int charIndex = textElement.ElementStartCharIndex; + if (textElement.IsBaseCharacter) { - // basic 2 byte characters - char character = word.String[charIndex]; - if (escaped) + if (textElement.IsEscapeSequence) { - if (character == 'm') - { - escaped = false; - } - AddEscapeSequence(character); - } - else - if (character == '\x1b') - { - escaped = true; - AddEscapeSequence(character); + AddEscapeSequence(textElement.Character); + continue; } - else - if (character == '\t') + + if (textElement.IsTab) { int spaces = tabSize - cellIndex % tabSize; for (int s = 0; s < spaces; ++s) @@ -205,38 +189,28 @@ void SetCell(Word word, int charIndex, char character = '\0', string? textElemen if (cellIndex >= maxWidth) break; } + continue; } - else - { - int displayWidth = Unicode.GetDisplayWidth(character); - if (displayWidth <= 0) - continue; + } - if (cellIndex + displayWidth > maxWidth) - continue; + if (textElement.DisplayWidth <= 0) + continue; - SetCell(word, charIndex, character: character); - if (displayWidth == 2) - { - SetCell(word, charIndex, character: '\0', isSecondCellOfWideCharacter: true); - } - } + if (cellIndex + textElement.DisplayWidth > maxWidth) + continue; + + if (textElement.IsBaseCharacter) + { + SetCell(word, charIndex, character: textElement.Character); } else { - int displayWidth = GetDisplayWidthOfComplexTextElement(word.String, elementStartIndex, elementCharCount); - if (displayWidth <= 0) - continue; - - if (cellIndex + displayWidth > maxWidth) - continue; + SetCell(word, charIndex, textElement: textElement.Element); + } - var textElement = word.String.Substring(elementStartIndex, elementCharCount); - SetCell(word, charIndex, textElement: textElement); - if (displayWidth == 2) - { - SetCell(word, charIndex, character: '\0', isSecondCellOfWideCharacter: true); - } + if (textElement.DisplayWidth == 2) + { + SetCell(word, charIndex, character: '\0', isSecondCellOfWideCharacter: true); } } @@ -288,57 +262,147 @@ public static int GetDisplayWidthOfComplexTextElement(string str, int elementCha public static int GetDisplayWidth(string str) { int tabSize = SelectorOptionHolder.GetInstance().Option.Theme.TabSize; - int count = 0; - bool escaped = false; + int cellCount = 0; - var textElementIndexes = System.Globalization.StringInfo.ParseCombiningCharacters(str); - for (int i = 0; i < textElementIndexes.Length; ++i) + var textElement = new TextElementEnumerator(str); + while (textElement.MoveNext()) { - var elementStartIndex = textElementIndexes[i]; - var elementStartIndexNext = (i + 1 == textElementIndexes.Length) ? str.Length : textElementIndexes[i + 1]; + if (textElement.IsBaseCharacter) + { + if (textElement.IsEscapeSequence) + continue; - var elementCharCount = elementStartIndexNext - elementStartIndex; - bool isBaseCharacter = elementCharCount == 1; - var charIndex = elementStartIndex; + if (textElement.IsTab) + { + cellCount += tabSize - cellCount % tabSize; + continue; + } + } - if (isBaseCharacter) + if (textElement.DisplayWidth <= 0) + continue; + cellCount += textElement.DisplayWidth; + } + + return cellCount; + } + + public class TextElementEnumerator + { + private readonly string _str; + private readonly int[] _elementIndexes; + private int _currentElementIndex = -1; + private int _currentElementCharCount; + private bool _isEscaped; + + public bool IsBaseCharacter => _currentElementCharCount == 1; + public bool IsEscapeSequence { get; set; } + public bool IsTab { get; set; } + public int DisplayWidth { get; set; } + public char Character {get; set; } = '\0'; + public string Element {get; set; } = ""; + public int ElementStartCharIndex {get; set;} + + public TextElementEnumerator(string str) + { + _str = str; + _elementIndexes = System.Globalization.StringInfo.ParseCombiningCharacters(str); + } + + public bool MoveNext() + { + if (_currentElementIndex >= _elementIndexes.Length) + return false; + + ++_currentElementIndex; + + if (_currentElementIndex >= _elementIndexes.Length) + return false; + + ElementStartCharIndex = _elementIndexes[_currentElementIndex]; + var elementStartIndexNext = (_currentElementIndex + 1 == _elementIndexes.Length) ? _str.Length : _elementIndexes[_currentElementIndex + 1]; + _currentElementCharCount = elementStartIndexNext - ElementStartCharIndex; + + IsEscapeSequence = false; + IsTab = false; + DisplayWidth = 0; + Character = '\0'; + Element = ""; + + if (IsBaseCharacter) { - char character = str[charIndex]; - if (escaped) + // basic 2 byte characters + Character = _str[ElementStartCharIndex]; + if (_isEscaped) { - if (character == 'm') + if (Character == 'm') { - escaped = false; + _isEscaped = false; } + IsEscapeSequence = true; } else - if (character == '\x1b') + if (Character == '\x1b') { - escaped = true; + _isEscaped = true; + IsEscapeSequence = true; } else - if (character == '\t') + if (Character == '\t') { - count += tabSize - count % tabSize; + IsTab = true; } else { - int displayWidth = Unicode.GetDisplayWidth(character); - if (displayWidth <= 0) - continue; - count += displayWidth; + DisplayWidth = Unicode.GetDisplayWidth(Character); } } else { - int displayWidth = GetDisplayWidthOfComplexTextElement(str, elementStartIndex, elementCharCount); - if (displayWidth <= 0) - continue; - count += displayWidth; + DisplayWidth = GetDisplayWidthOfComplexTextElement(_str, ElementStartCharIndex, _currentElementCharCount); + Element = _str.Substring(ElementStartCharIndex, _currentElementCharCount); + } + + return true; + } + } + + public class WrappedText + { + private int _originalLineCount; + private int[] _originalLineIndexes; + public string[] Lines; + + public WrappedText(string[] lines, int maxWidth) + { + _originalLineCount = lines.Length; + + List newLines = new(lines.Length); + List originalLineIndexes = new(lines.Length); + + for (int i = 0; i < lines.Length; ++i) + { + newLines.Add(lines[i]); + originalLineIndexes.Add(i); } + + Lines = newLines.ToArray(); + _originalLineIndexes = originalLineIndexes.ToArray(); } - return count; + // Returns the start line index after wrapping from the original (before wrapping) line index. + public int GetStartLineIndex(int originalLineIndex) + { + originalLineIndex = Math.Min(originalLineIndex, _originalLineCount - 1); + for (int i = 0; i < _originalLineIndexes.Length; ++i) + { + if (_originalLineIndexes[i] == originalLineIndex) + { + return i; + } + } + return -1; + } } private List _lines = new List(); From caddbfdc39e4633f53eb0013b977f54578e41c8c Mon Sep 17 00:00:00 2001 From: mdgrs <81177095+mdgrs-mei@users.noreply.github.com> Date: Sun, 4 Jan 2026 14:40:21 +0900 Subject: [PATCH 3/8] Reorder functions --- src/PowerShellRun/UI/TextBox.cs | 64 ++++++++++++++++----------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/PowerShellRun/UI/TextBox.cs b/src/PowerShellRun/UI/TextBox.cs index b2c0583..17c25f7 100644 --- a/src/PowerShellRun/UI/TextBox.cs +++ b/src/PowerShellRun/UI/TextBox.cs @@ -227,38 +227,6 @@ void SetCell(Word word, int charIndex, char character = '\0', string? textElemen } } - public static int GetDisplayWidthOfComplexTextElement(string str, int elementCharOffset, int elementCharCount) - { - Debug.Assert(elementCharCount > 1); - - int displayWidth = 0; - if (elementCharCount == 2) - { - if (Char.IsHighSurrogate(str[elementCharOffset])) - { - // surrogate pairs - int codePoint = Char.ConvertToUtf32(str[elementCharOffset], str[elementCharOffset + 1]); - displayWidth = Unicode.GetDisplayWidth(codePoint); - } - else - { - // combining characters - displayWidth = - Unicode.GetDisplayWidth(str[elementCharOffset]) + - Unicode.GetDisplayWidth(str[elementCharOffset + 1]); - displayWidth = Math.Min(displayWidth, 2); - } - } - else - { - // combining character sequences - // It's highly likely a wide character (might not be perfect). - displayWidth = 2; - } - - return displayWidth; - } - public static int GetDisplayWidth(string str) { int tabSize = SelectorOptionHolder.GetInstance().Option.Theme.TabSize; @@ -367,6 +335,38 @@ public bool MoveNext() } } + private static int GetDisplayWidthOfComplexTextElement(string str, int elementCharOffset, int elementCharCount) + { + Debug.Assert(elementCharCount > 1); + + int displayWidth = 0; + if (elementCharCount == 2) + { + if (Char.IsHighSurrogate(str[elementCharOffset])) + { + // surrogate pairs + int codePoint = Char.ConvertToUtf32(str[elementCharOffset], str[elementCharOffset + 1]); + displayWidth = Unicode.GetDisplayWidth(codePoint); + } + else + { + // combining characters + displayWidth = + Unicode.GetDisplayWidth(str[elementCharOffset]) + + Unicode.GetDisplayWidth(str[elementCharOffset + 1]); + displayWidth = Math.Min(displayWidth, 2); + } + } + else + { + // combining character sequences + // It's highly likely a wide character (might not be perfect). + displayWidth = 2; + } + + return displayWidth; + } + public class WrappedText { private int _originalLineCount; From 5635a771f8de875aa0d1e6984fef426fc707ee3b Mon Sep 17 00:00:00 2001 From: mdgrs <81177095+mdgrs-mei@users.noreply.github.com> Date: Sun, 4 Jan 2026 20:34:24 +0900 Subject: [PATCH 4/8] Simplify TextElement enumeration --- src/PowerShellRun/UI/TextBox.cs | 88 +++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/src/PowerShellRun/UI/TextBox.cs b/src/PowerShellRun/UI/TextBox.cs index 17c25f7..2cdf688 100644 --- a/src/PowerShellRun/UI/TextBox.cs +++ b/src/PowerShellRun/UI/TextBox.cs @@ -171,26 +171,23 @@ void SetCell(Word word, int charIndex, char character = '\0', string? textElemen if (cellIndex >= maxWidth) break; - int charIndex = textElement.ElementStartCharIndex; - if (textElement.IsBaseCharacter) + if (textElement.IsEscapeSequence) { - if (textElement.IsEscapeSequence) - { - AddEscapeSequence(textElement.Character); - continue; - } + AddEscapeSequence(textElement.Character); + continue; + } - if (textElement.IsTab) + int charIndex = textElement.ElementStartCharIndex; + if (textElement.IsTab) + { + int spaces = tabSize - cellIndex % tabSize; + for (int s = 0; s < spaces; ++s) { - int spaces = tabSize - cellIndex % tabSize; - for (int s = 0; s < spaces; ++s) - { - SetCell(word, charIndex, character: ' '); - if (cellIndex >= maxWidth) - break; - } - continue; + SetCell(word, charIndex, character: ' '); + if (cellIndex >= maxWidth) + break; } + continue; } if (textElement.DisplayWidth <= 0) @@ -235,20 +232,15 @@ public static int GetDisplayWidth(string str) var textElement = new TextElementEnumerator(str); while (textElement.MoveNext()) { - if (textElement.IsBaseCharacter) + if (textElement.IsTab) { - if (textElement.IsEscapeSequence) - continue; - - if (textElement.IsTab) - { - cellCount += tabSize - cellCount % tabSize; - continue; - } + cellCount += tabSize - cellCount % tabSize; + continue; } if (textElement.DisplayWidth <= 0) continue; + cellCount += textElement.DisplayWidth; } @@ -260,16 +252,16 @@ public class TextElementEnumerator private readonly string _str; private readonly int[] _elementIndexes; private int _currentElementIndex = -1; - private int _currentElementCharCount; private bool _isEscaped; - public bool IsBaseCharacter => _currentElementCharCount == 1; + public bool IsBaseCharacter => ElementCharCount == 1; public bool IsEscapeSequence { get; set; } public bool IsTab { get; set; } public int DisplayWidth { get; set; } public char Character {get; set; } = '\0'; public string Element {get; set; } = ""; public int ElementStartCharIndex {get; set;} + public int ElementCharCount {get; set;} public TextElementEnumerator(string str) { @@ -289,7 +281,7 @@ public bool MoveNext() ElementStartCharIndex = _elementIndexes[_currentElementIndex]; var elementStartIndexNext = (_currentElementIndex + 1 == _elementIndexes.Length) ? _str.Length : _elementIndexes[_currentElementIndex + 1]; - _currentElementCharCount = elementStartIndexNext - ElementStartCharIndex; + ElementCharCount = elementStartIndexNext - ElementStartCharIndex; IsEscapeSequence = false; IsTab = false; @@ -327,8 +319,8 @@ public bool MoveNext() } else { - DisplayWidth = GetDisplayWidthOfComplexTextElement(_str, ElementStartCharIndex, _currentElementCharCount); - Element = _str.Substring(ElementStartCharIndex, _currentElementCharCount); + DisplayWidth = GetDisplayWidthOfComplexTextElement(_str, ElementStartCharIndex, ElementCharCount); + Element = _str.Substring(ElementStartCharIndex, ElementCharCount); } return true; @@ -379,10 +371,44 @@ public WrappedText(string[] lines, int maxWidth) List newLines = new(lines.Length); List originalLineIndexes = new(lines.Length); + int tabSize = SelectorOptionHolder.GetInstance().Option.Theme.TabSize; for (int i = 0; i < lines.Length; ++i) { - newLines.Add(lines[i]); + string line = lines[i]; + int cellCount = 0; + var textElement = new TextElementEnumerator(line); + + int copyStartCharIndex = 0; + int copyCharCount = 0; + while (textElement.MoveNext()) + { + int displayWidth = textElement.DisplayWidth; + if (textElement.IsTab) + { + displayWidth = tabSize - cellCount % tabSize; + } + + if (displayWidth <= 0) + continue; + + cellCount += displayWidth; + if (cellCount <= maxWidth || copyCharCount == 0) + { + copyCharCount += textElement.ElementCharCount; + } + else + { + newLines.Add(line.Substring(copyStartCharIndex, copyCharCount)); + originalLineIndexes.Add(i); + + copyStartCharIndex = copyStartCharIndex + copyCharCount; + copyCharCount = 0; + cellCount = 0; + } + } + + newLines.Add(line.Substring(copyStartCharIndex, copyCharCount)); originalLineIndexes.Add(i); } From ea5f5ba45c09db2a748df6bb8c4b151229a92f9a Mon Sep 17 00:00:00 2001 From: mdgrs <81177095+mdgrs-mei@users.noreply.github.com> Date: Sun, 4 Jan 2026 20:45:17 +0900 Subject: [PATCH 5/8] Rename previewLinesLock with previewTaskLock --- src/PowerShellRun/Application/InternalEntry.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/PowerShellRun/Application/InternalEntry.cs b/src/PowerShellRun/Application/InternalEntry.cs index d51ab30..06a6220 100644 --- a/src/PowerShellRun/Application/InternalEntry.cs +++ b/src/PowerShellRun/Application/InternalEntry.cs @@ -31,7 +31,7 @@ internal class InternalEntry public BackgroundRunspace.Task? PreviewTask { get; set; } = null; private int _previewTaskExecutionCount = 0; private string[]? _previewLines = null; - private readonly object? _previewLinesLock = null; + private readonly object? _previewTaskLock = null; private bool _previewLinesUpdatedByTask = false; public InternalEntry(SelectorEntry selectorEntry) @@ -71,7 +71,7 @@ public InternalEntry(SelectorEntry selectorEntry) if (selectorEntry.PreviewAsyncScript is not null) { - _previewLinesLock = new object(); + _previewTaskLock = new object(); } } @@ -89,10 +89,10 @@ public ActionKey[] GetActionKeysMultiSelection() public void CompletePreviewTask(System.Collections.ObjectModel.Collection taskResult) { - if (_previewLinesLock is null) + if (_previewTaskLock is null) return; - lock (_previewLinesLock) + lock (_previewTaskLock) { if (taskResult.Count > 0 && taskResult[0] is not null) { @@ -106,10 +106,10 @@ public void CompletePreviewTask(System.Collections.ObjectModel.Collection Date: Sun, 4 Jan 2026 21:41:23 +0900 Subject: [PATCH 6/8] Implement a function to get wrapped preview lines from InternalEntry --- .../Application/InternalEntry.cs | 19 +++++++++++++++++++ src/PowerShellRun/UI/TextBox.cs | 11 ++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/PowerShellRun/Application/InternalEntry.cs b/src/PowerShellRun/Application/InternalEntry.cs index 06a6220..e7af23d 100644 --- a/src/PowerShellRun/Application/InternalEntry.cs +++ b/src/PowerShellRun/Application/InternalEntry.cs @@ -33,6 +33,8 @@ internal class InternalEntry private string[]? _previewLines = null; private readonly object? _previewTaskLock = null; private bool _previewLinesUpdatedByTask = false; + private TextBox.WrappedText? _wrappedPreviewLinesCache = null; + private int _wrappedPreviewLinesCacheWidth = 0; public InternalEntry(SelectorEntry selectorEntry) { @@ -115,6 +117,23 @@ public void CompletePreviewTask(System.Collections.ObjectModel.Collection Date: Sun, 4 Jan 2026 21:59:02 +0900 Subject: [PATCH 7/8] Add PreviewTextWrapMode --- src/PowerShellRun/Application/ResultWindow.cs | 19 +++++++++++++++++-- src/PowerShellRun/Application/Theme.cs | 1 + src/PowerShellRun/UI/TextWrapMode.cs | 9 +++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/PowerShellRun/UI/TextWrapMode.cs diff --git a/src/PowerShellRun/Application/ResultWindow.cs b/src/PowerShellRun/Application/ResultWindow.cs index 669316f..6cff112 100644 --- a/src/PowerShellRun/Application/ResultWindow.cs +++ b/src/PowerShellRun/Application/ResultWindow.cs @@ -541,13 +541,28 @@ private void BuildUi() { if (theme.PreviewEnable) { - var previewLines = internalEntry.GetPreviewLines(); + string[]? previewLines = null; + int previewInitialVerticalScroll = 0; + if (theme.PreviewTextWrapMode != TextWrapMode.None) + { + var wrappedPreview = internalEntry.GetWrappedPreviewLines(_previewBox.GetInnerLayout().Width); + if (wrappedPreview is not null) + { + previewLines = wrappedPreview.Lines; + previewInitialVerticalScroll = wrappedPreview.GetStartLineIndex(selectorEntry.PreviewInitialVerticalScroll); + } + } + else + { + previewLines = internalEntry.GetPreviewLines(); + previewInitialVerticalScroll = selectorEntry.PreviewInitialVerticalScroll; + } int previewLineCount = (previewLines is not null) ? previewLines.Length : 0; if (IsFocusedEntryUpdated() || _isFocusedEntryContentUpdated) { _previewBox.ClearAndSetVerticalScroll( - selectorEntry.PreviewInitialVerticalScroll, + previewInitialVerticalScroll, previewLineCount); } else diff --git a/src/PowerShellRun/Application/Theme.cs b/src/PowerShellRun/Application/Theme.cs index 2097e8e..114ac72 100644 --- a/src/PowerShellRun/Application/Theme.cs +++ b/src/PowerShellRun/Application/Theme.cs @@ -88,6 +88,7 @@ public class Theme public FontColor? EntryScrollBarBackgroundColor { get; set; } = null; public bool PreviewEnable { get; set; } = true; + public TextWrapMode PreviewTextWrapMode { get; set; } = TextWrapMode.None; public FontColor? PreviewForegroundColor { get; set; } = null; public FontColor? PreviewBackgroundColor { get; set; } = null; public FontStyle PreviewStyle { get; set; } = FontStyle.Default; diff --git a/src/PowerShellRun/UI/TextWrapMode.cs b/src/PowerShellRun/UI/TextWrapMode.cs new file mode 100644 index 0000000..011de59 --- /dev/null +++ b/src/PowerShellRun/UI/TextWrapMode.cs @@ -0,0 +1,9 @@ +namespace PowerShellRun; + +public enum TextWrapMode +{ + None, + + // Wrap anywhere without considering words. + Character, +} From aab79481cf14d11582975a832e0e94dc93fca356 Mon Sep 17 00:00:00 2001 From: mdgrs <81177095+mdgrs-mei@users.noreply.github.com> Date: Mon, 5 Jan 2026 20:31:37 +0900 Subject: [PATCH 8/8] Rename with PreviewWrappedTextCache --- src/PowerShellRun/Application/InternalEntry.cs | 16 ++++++++-------- src/PowerShellRun/Application/ResultWindow.cs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/PowerShellRun/Application/InternalEntry.cs b/src/PowerShellRun/Application/InternalEntry.cs index e7af23d..566165d 100644 --- a/src/PowerShellRun/Application/InternalEntry.cs +++ b/src/PowerShellRun/Application/InternalEntry.cs @@ -33,8 +33,8 @@ internal class InternalEntry private string[]? _previewLines = null; private readonly object? _previewTaskLock = null; private bool _previewLinesUpdatedByTask = false; - private TextBox.WrappedText? _wrappedPreviewLinesCache = null; - private int _wrappedPreviewLinesCacheWidth = 0; + private TextBox.WrappedText? _previewWrappedTextCache = null; + private int _previewWrappedTextCacheWidth = 0; public InternalEntry(SelectorEntry selectorEntry) { @@ -117,21 +117,21 @@ public void CompletePreviewTask(System.Collections.ObjectModel.Collection