Bracket matching in DocBook and other text-centric formats
Posted: Tue Aug 19, 2008 2:01 pm
Many IDEs and text editors provide the ability to perform bracket matching with both highlighting and input caret warping.
For example, if I had the following text in a table cell:
(device:getPolicy('DRM') = ('CD', 'SD') and exists(./rights)) or (not(exists(./rights)) and number(./width) <= device:getPolicy('pixelsx'))
It would be very useful to be able to see when I have correctly entered the right number of brackets (i.e. all brackets are balanced) - perhaps by highlighting any bracket paired with the open or close bracket next to the input caret.
It would also be very useful to be able to place the input caret after a close bracket (or before an open bracket) and be able to jump (or warp) the input caret to the matching open (or close) bracket, if any.
For example, if I had the following text in a table cell:
(device:getPolicy('DRM') = ('CD', 'SD') and exists(./rights)) or (not(exists(./rights)) and number(./width) <= device:getPolicy('pixelsx'))
It would be very useful to be able to see when I have correctly entered the right number of brackets (i.e. all brackets are balanced) - perhaps by highlighting any bracket paired with the open or close bracket next to the input caret.
It would also be very useful to be able to place the input caret after a close bracket (or before an open bracket) and be able to jump (or warp) the input caret to the matching open (or close) bracket, if any.