From dfd7aa5f313934ec3877ab4e07b960a2d0057f8a Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Wed, 5 Sep 2012 20:30:03 +0400 Subject: [PATCH] minor fixes --- .../editorActions/BraceMatcherBasedSelectioner.java | 3 ++- .../intellij/execution/console/LanguageConsoleImpl.java | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/BraceMatcherBasedSelectioner.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/BraceMatcherBasedSelectioner.java index d577a1a38c06..bddf785a2a95 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/BraceMatcherBasedSelectioner.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/BraceMatcherBasedSelectioner.java @@ -58,7 +58,7 @@ public abstract class BraceMatcherBasedSelectioner extends ExtendWordSelectionHa && !stack.isEmpty() && braceMatcher.isPairBraces((last = stack.getLast()).third, iterator.getTokenType())) { stack.removeLast(); result.addAll(expandToWholeLine(editorText, new TextRange(last.first, iterator.getEnd()))); - int bodyStart = last.second + 1; + int bodyStart = last.second; int bodyEnd = iterator.getStart(); while (bodyStart < textLength && Character.isWhitespace(editorText.charAt(bodyStart))) bodyStart ++; while (bodyEnd > 0 && Character.isWhitespace(editorText.charAt(bodyEnd - 1))) bodyEnd --; @@ -69,4 +69,5 @@ public abstract class BraceMatcherBasedSelectioner extends ExtendWordSelectionHa result.add(e.getTextRange()); return result; } + } \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java b/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java index d04606d5b767..c3b7f3d1bc28 100644 --- a/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java @@ -30,6 +30,7 @@ import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.actions.EditorActionUtil; +import com.intellij.openapi.editor.colors.EditorColors; import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.colors.impl.DelegateColorScheme; import com.intellij.openapi.editor.event.*; @@ -522,8 +523,11 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider { for (RangeHighlighter rangeHighlighter : from.getAllHighlighters()) { if (!rangeHighlighter.isValid()) continue; Object tooltip = rangeHighlighter.getErrorStripeTooltip(); - HighlightSeverity severity = tooltip instanceof HighlightInfo? ((HighlightInfo)tooltip).getSeverity() : null; - if (severity != HighlightSeverity.INFORMATION) continue; + HighlightInfo highlightInfo = tooltip instanceof HighlightInfo? (HighlightInfo)tooltip : null; + if (highlightInfo != null) { + if (highlightInfo.getSeverity() != HighlightSeverity.INFORMATION) continue; + if (highlightInfo.type.getAttributesKey() == EditorColors.IDENTIFIER_UNDER_CARET_ATTRIBUTES) continue; + } final int localOffset = textRange.getStartOffset(); final int start = Math.max(rangeHighlighter.getStartOffset(), localOffset) - localOffset; final int end = Math.min(rangeHighlighter.getEndOffset(), textRange.getEndOffset()) - localOffset;