AvaloniaEdit
AvaloniaEdit copied to clipboard
Word wrap artificially wraps line after new VisualLineElement
It appears that, when word wrap is active, breaking a line with a new VisualLineElement
causes the line to wrap immediately after that element.
The easiest way to see this is to launch the AvaloniaEdit.Demo project, turn on word wrap, scroll to line 41 and add the text "https://test" in the middle of the string literal. On both an Arch Linux system and a Windows 10 system I get an unintended line break immediately after the end of the URL, where a VisualLineLinkText
element has been inserted by its respective generator. I've also observed this behavior with a custom class that inherited from VisualLineElement
(this is how I discovered the behavior) so I know it's not just the link element which does it.
I'm working on a minimum reproducible project so that I can try to take a closer look at what's happening, but I wanted to check in case someone already had an idea what might be happening and have a good idea how to fix it.
Otherwise, between this and @Gillibald's comment in #223 regarding virtualizing line text maybe the word wrap feature could use some attention? I'd be happy to try to dig in and contribute here, though the codebase is pretty large and I find I'm spending most of my time sort of wandering through it. If some effort here would be welcome I would be very appreciative of anyone who could point me in the direction of even where to start looking.
Word wrap on, before adding URL:
After adding URL:
Note there's no carriage return after the URL...here it is with word wrap turned off:
Word wrap algorithm is completely new in PR #216. Could you try if now it behaves as expected?
Sure thing, this is commit b11e3be2? Branch feature/TextFormatterPort?
Yes.
I need to make sure I'm not messing something up, but it does seem to work correctly on Windows, but somehow not on Linux. Give me a few minutes to clone everything clean and confirm.
Ok! Yes, everything works correctly in b11e3be on both Windows and Linux. I was getting mixed up with multiple clones. Thanks for the quick response and I apologize for not digging deeper on my own.
Do you want me to close this issue now or leave it open until PR #216 gets merged?
Let's keep it open until that PR is merged
Can close now.