Incorrect highlight of matching parenthesis

Using latest stable KWGT.

When composing a multi-line formula, highlighting the matching opening/closing parenthesis is much appreciated. Without it, the readability of complex nested if-statements is difficult to read.

However, the way the parentheses are highlighted isn't always correct. If there are multiple nested brackets, often the wrong one gets colored blue, confusing the user and making debugging more difficult. Please see attachment for an example where I move cursor after "))", before "))" and between "))". When the cursor is between the parentheses, the highlighted ones incorrectly show that they're related.

The issue is not limited to this case - a different issue's screenshot shows the same problem, so the author got confused: