From aeefdbf06bc9d0ec1d20406228d2715a379a44c4 Mon Sep 17 00:00:00 2001 From: Pavel Dolgov Date: Fri, 15 Jul 2016 12:48:27 +0300 Subject: [PATCH] Java inspection: When the element to be processed by information-level inspections is a whitespace (and the caret is at the start of the white space) process the nearest previous non-space element instead. (IDEA-157727) --- .../intellij/codeInsight/daemon/impl/ShowIntentionsPass.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java index 682db8848c36..f991747ef7b4 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java @@ -315,7 +315,7 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass { if (HighlightingLevelManager.getInstance(project).shouldInspect(hostFile)) { PsiElement adjustedElement = psiElement; int adjustedOffset = offset; - if (psiElement instanceof PsiWhiteSpace) { + if (psiElement instanceof PsiWhiteSpace && offset == psiElement.getTextRange().getStartOffset()) { final PsiElement prev = psiElement.getPrevSibling(); if (prev != null) { adjustedElement = prev;