Open qqkookie opened 1 year ago
This issue seems to be related to a problem with the RichEditBox itself rather than Notepads.
The underlying problem lies with the ScrollViewer in the RichEditBox, which has a maximum content length limitation. When this length is reached, the RichEditBox displays invisible lines.
For a more detailed explanation, I recommend checking out this StackOverflow answer: https://stackoverflow.com/questions/44608549/uwp-textbox-maximum-lines-limitation
This issue seems to be related to a problem with the RichEditBox itself rather than Notepads.
The underlying problem lies with the ScrollViewer in the RichEditBox, which has a maximum content length limitation. When this length is reached, the RichEditBox displays invisible lines.
For a more detailed explanation, I recommend checking out this StackOverflow answer: https://stackoverflow.com/questions/44608549/uwp-textbox-maximum-lines-limitation
I have tested very simple text editor (a DIY-Notepad clone)[https://github.com/qqkookie/XPAccApps/tree/master/notepad] with RichEdit control ("Msftedit.dll") It is multi-tabbed and has vertical scrollbar, but without horizontal scroll bar or line number column. It does not have such line limit problem and display text beyond the 13,000 lines without invisible line or performance problem. It does not use any special workaround to avoid the 13,000 lines limit. So, it is not fundamental limit of RichEdit control itself. There may be some workaround to avoid using the culprit, ScrollViewer control.
Yes, you are correct. This is not a limit of the RichEditBox itself, but rather the scroll viewer. Both UWP and WinUI platforms share the same problem, with their textbox/RichEditBox being slow due to this. The only workaround I have currently found here was to create a textbox from scratch. The new Notepad in Windows 11 also does not use the UWP/WinUI textbox. I believe they are also utilizing the textbox from Msftedit.dll. However, as far as I know, there is no official and easy way of hosting Win32 controls in a UWP app.
More to add:
It is not about 13,000 lines issue, it is about the virtual drawing canvas size limit set in the RickEdit/ScrollViewer component in WinRT. If you change text to a smaller font, it can fit more than 13,000 lines. But you got the idea.
You can blame MSFT, but since no one cares about UWP or Windows app development anymore so there is no urgent need for improving it anyway.
I wish I could use an internal build of the latest RichEdit control that Windows Notepad uses to make it better but sadly it is closed source (for a reason).
Describe the bug Text in the lines beyond 12,078-th line become invisible line.
To Reproduce
Expected behavior The text of lines beyond 12,078 should be visible.
Screenshots
Desktop (please complete the following information):
Additional context