Open 25minutes opened 1 year ago
The slow is not replaceable on my system. you can configure Notepad2 to use Direct2D or different wrap mode (default "Automatic word wrap" is the slowest one) to speedup word wrap.
The slow is not replaceable on my system.
Reproduced when using "2nd Text File", works fine with "Text File" scheme.
Thanks for the quick response.
I've changed wrap mode to "wrap text between words" but the issue persists. Direct2D doesn't help either, and if possible, I'd prefer to keep using GDI because one of my PC is still Windows 7 and Direct2D doesn't work well.
I'm always using the default "Text File" scheme. I though "2nd Text File" is simply a set with different font/color settings. Would it affect word wrap function?
I attach my Notepad2.ini for your reference. You might need change font because Monaco monospaced font isn't system default. Notepad2.zip
The slow is caused by wrap all lines in one go: https://github.com/zufuliu/notepad2/blob/95a5f62a62933e4759daa1cb9eb4f9ce6ef3d8bf/scintilla/src/Editor.cxx#L5542-L5548
comment out SciCall_EnsureVisible(iDocTopLine);
fixed the slow:
https://github.com/zufuliu/notepad2/blob/95a5f62a62933e4759daa1cb9eb4f9ce6ef3d8bf/src/Notepad2.c#L4015-L4023
Awesome! You identity the root cause so quickly :)
Fixed by 763569c9ee2470017d0e13db89d0e7f4d50a0d49. however we should really implement parallel WrapBlock()
(Scintilla 5.3.4) to speedup wrap all lines.
https://github.com/zufuliu/notepad2/blob/95a5f62a62933e4759daa1cb9eb4f9ce6ef3d8bf/scintilla/src/Editor.cxx#L1494-L1496
Marked as breaking change: after toggle word wrap, caret maybe invisible with the change.
In latest stable version Notepad2_en_AVX2_v4.23.06r4862, word wrap is slow. For example, it takes over 5 seconds on a small 1.2MB text file (sample file attached). 1.zip
Reproduce steps:
This doesn't happen on original notepad2-mod and Notepad3. On the same PC, both of them complete word wrap almost instantly.
As all these 3 editors are Scintilla based, it's a bit strange to see such a big difference.
BTW, I've already configured notepad2 to use GDI and monospaced font.