force using current document text in LayeredLexerEditorHighlighter.createIterator, even in bulk mode (IDEA-CR-10979)

This commit is contained in:
peter
2016-05-25 08:45:23 +02:00
parent b3efd0cdcd
commit 831a4ee5cd
@@ -174,11 +174,14 @@ public class LayeredLexerEditorHighlighter extends LexerEditorHighlighter {
// do NOT synchronize before updateLayers due to deadlock with PsiLock
final boolean changed = updateLayers();
//noinspection SynchronizeOnThis
synchronized (this) {
if (changed) {
CharSequence text = myText;
myText = null;
setText(text);
Document document = getDocument();
if (document != null) {
myText = null;
super.setText(document.getImmutableCharSequence());
}
}
return new LayeredHighlighterIteratorImpl(startOffset);
}