IDEA-185869 minimized file folded comment issue

This commit is contained in:
Dmitry Batrak
2018-02-07 11:38:53 +03:00
parent 482a508f02
commit fa65a4df95
@@ -1,6 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInsight.hint;
import com.intellij.openapi.application.ApplicationManager;
@@ -63,7 +61,7 @@ public class EditorFragmentComponent extends JPanel {
}
try {
Document doc = editor.getDocument();
int endOffset = endLine < doc.getLineCount() ? doc.getLineEndOffset(endLine) : doc.getTextLength();
int endOffset = endLine < doc.getLineCount() ? doc.getLineEndOffset(Math.max(0, endLine - 1)) : doc.getTextLength();
int widthAdjustment = newRendering ? EditorUtil.getSpaceWidth(Font.PLAIN, editor) : 0;
textImageWidth = Math.min(
editor.getMaxWidthInRange(doc.getLineStartOffset(startLine), endOffset) + widthAdjustment,