Is MatchDecorator matching supposed to work with very long text?

I have a MatchDecorator that matches image base64 strings which are often pretty big, I noticed it’ll start failing to match when the text exceeds about 5000 characters (the strings themselves still fit the regexp), is this behavior expected? If yes is there any way to get around?

What is happening is that the editor avoids rendering parts of very long lines, and doesn’t include those in visibleRanges, which is what MatchDecorator matches over. This patch makes it match into such hidden ranges, and adds an option that allows you to control how much.

1 Like

Thanks for the fast patch! This works amazingly.

Does it make sense to allow it match the entire line instead of a range (by like maxLength: -1)? Setting maxLength: REALLY_BIG_NUMBER works, but wondering if supporting this natively would be reasonable

Right, setting it to a large number makes it obvious that any performance issues introduced are your own fault, and doesn’t require any additional code paths, so I think I prefer that.

That makes sense :+1: