It is often useful when you close a bracket to know which bracket is the corresponding opening bracket, for this jedit has the StructureMatcher interface and the default implementation gives you this information, by surrounding the opening bracket when you type its associated closing bracket.

On the other hand, the XML plugin gives you a more useful information when closing an XML tag. Let's see it in action with this simple XML file from the w3c


On the left, the caret is within the </note> closing tag and so the entire opening <note> tag is being highlighted. Similarly, on the right, the caret is within the opening <heading> tag and consequently the closing </heading> gets highlighted. This is particularly useful when editing xml documents.

So the idea was to have the same sort of behaviour for R scripts. Here's a start, but I also plan to do something with the curly brackets to deal with for loops, function definitions and various apply calls, ... (see that post)

structurematch.png structurematch2.png