Community
Participate
Working Groups
The usual character matching method, DefaultCharacterPairMatcher.performMatch, allows you to find the matching peer for the character at a particular position. findPeer generalizes this by finding the matching peer for a user-specified character, starting from a particular position. This can be useful in situations such as auto edit where you're considering changes to a document that haven't actually been applied yet, so the character to find a peer for has not yet been inserted into the document.
There's no findPeer(...) method. Did you mean findMatchingPeer(...)? If so, this can't be made public since it needs the private DocumentPartitionAccessor which we don't want to make public.
It turns out that I had refactored the class and then forgotten about it. So let me rephrase the feature request. I suggest that performMatch be refactored so that all code except for the first line is made into a new method (which could be called findPeer) that takes the document, offset and prevChar as arguments. This new method should be public for the reasons described in the original request.
I'd accept a good quality patch with some tests.
No plans to do this.