revert fix for IDEA-105408

caret row becomes almost invisible in some languages (PHP, Velocity, etc)
This commit is contained in:
Dmitry Batrak
2016-07-14 14:42:11 +03:00
parent 243003c0b8
commit 29e40c76f8
6 changed files with 16 additions and 15 deletions
@@ -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;
@@ -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;
@@ -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;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

@@ -69,9 +69,10 @@ public class EditorPaintingTest extends AbstractEditorTest {
checkResult();
}
public void testCaretRowHasLowerPriorityThanSyntax() throws Exception {
public void testCaretRowWinsOverSyntaxEvenInPresenceOfHighlighter() throws Exception {
initText("foo");
setUniformEditorHighlighter(new TextAttributes(null, Color.red, null, null, Font.PLAIN));
addRangeHighlighter(0, 3, 0, null, Color.blue);
checkResult();
}