From d334f591742fdcdebe946b24745d46b3eca55adc Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 5 Oct 2011 20:33:06 +0200 Subject: [PATCH] don't red-highlight unmatched brace pairs --- .../codeInsight/highlighting/BraceHighlightingHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceHighlightingHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceHighlightingHandler.java index e81ed0b9636d..3215743eb71d 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceHighlightingHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceHighlightingHandler.java @@ -364,7 +364,7 @@ public class BraceHighlightingHandler { TextRange brace2 = iterator.atEnd() ? null : TextRange.create(iterator.getStart(), iterator.getEnd()); - highlightBraces(brace2, brace1, matched, false, fileType); + highlightBraces(matched ? brace2 : null, brace1, matched, false, fileType); } private void highlightLeftBrace(HighlighterIterator iterator, boolean scopeHighlighting, FileType fileType) { @@ -373,7 +373,7 @@ public class BraceHighlightingHandler { TextRange brace2End = iterator.atEnd() ? null : TextRange.create(iterator.getStart(), iterator.getEnd()); - highlightBraces(brace1Start, brace2End, matched, scopeHighlighting, fileType); + highlightBraces(brace1Start, matched ? brace2End : null, matched, scopeHighlighting, fileType); } private void highlightBraces(final TextRange lBrace, TextRange rBrace, boolean matched, boolean scopeHighlighting, FileType fileType) {