diff --git a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BackgroundHighlighter.java b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BackgroundHighlighter.java index 4272ed9330a6..1d95fca9a478 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BackgroundHighlighter.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/BackgroundHighlighter.java @@ -190,7 +190,7 @@ final class BackgroundHighlighter { int end = caret.getSelectionEnd(); CharSequence sequence = document.getCharsSequence(); String toFind = sequence.subSequence(start, end).toString(); - if (toFind.trim().isEmpty()) { + if (toFind.trim().isEmpty() || toFind.contains("\n")) { return false; } String previous = editor.getUserData(HIGHLIGHTED_TEXT);