AvaloniaUI / AvaloniaEdit

Avalonia-based text editor (port of AvalonEdit)
MIT License
781 stars 151 forks source link

Generator support for long lines #223

Open mattj23 opened 2 years ago

mattj23 commented 2 years ago

Commit ccc8f66b, part of PR #172, categorically disabled all generators for long lines.

I understand the issues which lead to that pull request, but would we be open to finding a reasonable way to allow certain generators to run on long lines? I'm working on a markdown editor and it isn't uncommon to have prose with lines that long.

Some ways it might be possible to allow client code to opt into allowing a generator to avoid being disabled:

Thoughts? I'm happy to make the enhancement and submit a PR.

Gillibald commented 2 years ago

Long term we need horizontal virtualization of text lines so this performance hit can entirly be avoided. At the moment Avalon(ia)Edit is processing a line up until it reaches a mandatory break. This needs to be changed to only process text until we reach off screen and start processing portions of the text on demand when the current viewport changes.

It should be possible to make disabling the generators for long lines an option instead of disableing them all the time.

danipen commented 2 years ago

Hey @mattj23,

It should be possible to make disabling the generators for long lines an option instead of disabling them all the time.

Yes, what about setting up a couple of options in TextEditorOptions?:

About this:

I'm working on a markdown editor and it isn't uncommon to have prose with lines that long.

I have a side question about it: https://github.com/AvaloniaUI/AvaloniaEdit/discussions/224