Uses StringBuilder and char span indexof search to reduce intermediate allocations.
The new implementation behaves slightly different compared to old implementation. In synthetic LFCR scenario it is correctly removed while the old implementation left the CR, which seems like an off-by-one error.
* Skip rune list allocation from accessing Cell.CombiningMarks property
The getter would every time allocate a new list when the backing field was not assigned, which is most of the time.
* Fix comment about performance
I accidentally word. Is this dangerous?
* Fixes#3968. Menu appears in wrong place when opened in a subview
* Fixes#3965. Cannot exit a Window with a CanFocus true MenuBar
* Fixes#3981. Drivers crash when middle or right click on a ContextMenu item
---------
Co-authored-by: Tig <tig@users.noreply.github.com>
* Change IConsoleOutput.Write(string) overload parameter to ReadOnlySpan<char>
Allows the caller more flexibility about choosing a buffer per use case.
* NetOutput: Write StringBuilder directly to the std out text stream
* Add EscSeqUtils.CSI_WriteCursorPosition
Writes cursor position sequence to text writer without string allocation.
* NetOutput: Skip cursor position escape sequence string allocation
* Replace CSI_(Enable|Disable)MouseEvents static properties with readonly fields
Changed for the sake of consistency with rest of the EscSegutils fields rather than performance. Also prevents bugs from accidentally setting the properties.
* Use EscSeqUtils.CSI_Append(Foreground|Background)ColorRGB in v2 drivers
* WindowsOutput SetCursorVisibility: Remove intermediate string builder
* WindowsOutput.WriteToConsole: Use rented array as intermediate write buffer
The large intermediate string builder remains a challenge. :)
* NetOutput: Console.Out for the sake of consistency
Also might have missed one of the Console.Out.Write(StringBuilder) calls...
* Avoid Rune.ToString() in NetOutput.Write(IOutputBuffer)
---------
Co-authored-by: Tig <tig@users.noreply.github.com>
* Fixes#3964. Null Reference in DoDrawBorderAndPadding
* Fix unit test.
* Ensures closing all opened menus that belong to another top when a new modal top is opened.
* Reformat
---------
Co-authored-by: Tig <tig@users.noreply.github.com>