From bc9169ffa7f19d4fc781e32439520b94c549dbae Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Tue, 29 Dec 2015 18:48:01 +0300 Subject: [PATCH] diagnostics for EA-77265 --- .../intellij/openapi/editor/impl/view/TextLayoutCache.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/TextLayoutCache.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/TextLayoutCache.java index 47bc4e1aff3c..a1cfa0fa9ea6 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/TextLayoutCache.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/TextLayoutCache.java @@ -16,6 +16,8 @@ package com.intellij.openapi.editor.impl.view; import com.intellij.openapi.Disposable; +import com.intellij.openapi.diagnostic.Attachment; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.editor.ex.PrioritizedDocumentListener; @@ -35,6 +37,8 @@ import java.util.*; * @see LineLayout */ class TextLayoutCache implements PrioritizedDocumentListener, Disposable { + private static final Logger LOG = Logger.getInstance(TextLayoutCache.class); + private static final int MAX_CHUNKS_IN_ACTIVE_EDITOR = 1000; private static final int MAX_CHUNKS_IN_INACTIVE_EDITOR = 10; @@ -125,6 +129,7 @@ class TextLayoutCache implements PrioritizedDocumentListener, Disposable { @NotNull LineLayout getLineLayout(int line) { checkDisposed(); + if (line >= myLines.size()) LOG.error("Unexpected cache state", new Attachment("editorState.txt", myView.getEditor().dumpState())); LineLayout result = myLines.get(line); if (result == null || result == myBidiNotRequiredMarker) { result = LineLayout.create(myView, line, result == myBidiNotRequiredMarker);