From 29e40c76f8e4e0b887f9ec96a95440d2e9409a62 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Thu, 14 Jul 2016 14:41:08 +0300 Subject: [PATCH] revert fix for IDEA-105408 caret row becomes almost invisible in some languages (PHP, Velocity, etc) --- .../openapi/editor/markup/HighlighterLayer.java | 4 ++-- .../openapi/editor/impl/IterationState.java | 12 ++++++------ .../openapi/editor/impl/view/IterationState.java | 12 ++++++------ .../caretRowHasLowerPriorityThanSyntax.png | Bin 132 -> 0 bytes ...wWinsOverSyntaxEvenInPresenceOfHighlighter.png | Bin 0 -> 130 bytes .../openapi/editor/EditorPaintingTest.java | 3 ++- 6 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 platform/platform-tests/testData/editor/painting/caretRowHasLowerPriorityThanSyntax.png create mode 100644 platform/platform-tests/testData/editor/painting/caretRowWinsOverSyntaxEvenInPresenceOfHighlighter.png diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/HighlighterLayer.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/HighlighterLayer.java index 831aab757153..779b3f534315 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/HighlighterLayer.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/markup/HighlighterLayer.java @@ -16,8 +16,8 @@ package com.intellij.openapi.editor.markup; public interface HighlighterLayer { - int CARET_ROW = 1000; - int SYNTAX = 2000; + int SYNTAX = 1000; + int CARET_ROW = 2000; int ADDITIONAL_SYNTAX = 3000; int GUARDED_BLOCKS = 3500; int WARNING = 4000; diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/IterationState.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/IterationState.java index f1ac3f8a2bd2..8acaf90927fb 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/IterationState.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/IterationState.java @@ -462,16 +462,16 @@ public final class IterationState { guard = null; } - if (syntax != null && highlighter.getLayer() < HighlighterLayer.SYNTAX) { - cachedAttributes.add(syntax); - syntax = null; - } - if (caret != null && highlighter.getLayer() < HighlighterLayer.CARET_ROW) { cachedAttributes.add(caret); caret = null; } + if (syntax != null && highlighter.getLayer() < HighlighterLayer.SYNTAX) { + cachedAttributes.add(syntax); + syntax = null; + } + TextAttributes textAttributes = highlighter.getTextAttributes(); if (textAttributes != null && textAttributes != TextAttributes.ERASE_MARKER) { cachedAttributes.add(textAttributes); @@ -484,8 +484,8 @@ public final class IterationState { if (selection != null) cachedAttributes.add(selection); if (fold != null) cachedAttributes.add(fold); if (guard != null) cachedAttributes.add(guard); - if (syntax != null) cachedAttributes.add(syntax); if (caret != null) cachedAttributes.add(caret); + if (syntax != null) cachedAttributes.add(syntax); Color fore = null; Color back = isInGuardedBlock ? myReadOnlyColor : null; diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/IterationState.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/IterationState.java index 620208b280e9..f6066c69f1d5 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/IterationState.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/IterationState.java @@ -516,16 +516,16 @@ public class IterationState { guard = null; } - if (syntax != null && highlighter.getLayer() < HighlighterLayer.SYNTAX) { - cachedAttributes.add(syntax); - syntax = null; - } - if (caret != null && highlighter.getLayer() < HighlighterLayer.CARET_ROW) { cachedAttributes.add(caret); caret = null; } + if (syntax != null && highlighter.getLayer() < HighlighterLayer.SYNTAX) { + cachedAttributes.add(syntax); + syntax = null; + } + TextAttributes textAttributes = highlighter.getTextAttributes(); if (textAttributes != null && textAttributes != TextAttributes.ERASE_MARKER) { cachedAttributes.add(textAttributes); @@ -535,8 +535,8 @@ public class IterationState { if (selection != null) cachedAttributes.add(selection); if (fold != null) cachedAttributes.add(fold); if (guard != null) cachedAttributes.add(guard); - if (syntax != null) cachedAttributes.add(syntax); if (caret != null) cachedAttributes.add(caret); + if (syntax != null) cachedAttributes.add(syntax); Color fore = null; Color back = isInGuardedBlock ? myReadOnlyColor : null; diff --git a/platform/platform-tests/testData/editor/painting/caretRowHasLowerPriorityThanSyntax.png b/platform/platform-tests/testData/editor/painting/caretRowHasLowerPriorityThanSyntax.png deleted file mode 100644 index a1abb680a19db063c47a7d7b63172d7676497fe1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^8bHj$!3HD+4*&NBQr?~}jv*Ddl7E~(@S)z}!}{Yc ziEJspJQ)=MmJ<>;v_Du-rl1+_56cggmC~gO^Ij->-RgTe~DWM4fi#RPh diff --git a/platform/platform-tests/testData/editor/painting/caretRowWinsOverSyntaxEvenInPresenceOfHighlighter.png b/platform/platform-tests/testData/editor/painting/caretRowWinsOverSyntaxEvenInPresenceOfHighlighter.png new file mode 100644 index 0000000000000000000000000000000000000000..c8fb28e88f96f777c436d46c10930d23f49cf2da GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^8bHj$!3HD+4*&NBQl6eJjv*Ddl7IYv{qg_79?1X; z9v+Q~0Ly|678w~<6Q-