IDEA-161586 Intermittent Intellij hangs with 2016.2.4 on Linux

safe fix, that should improve the situation - hangs shouldn't happen
repeatedly now, only occasionally
This commit is contained in:
Dmitry Batrak
2017-06-20 12:39:42 +03:00
parent cbdf7d20ec
commit 7db31b63b3
@@ -1485,9 +1485,11 @@ public class CaretImpl extends UserDataHolderBase implements Caret, Dumpable {
InlayModelImpl inlayModel = myEditor.getInlayModel();
int startOffset = marker.getStartOffset();
int endOffset = marker.getEndOffset();
if (!myEditor.offsetToVisualPosition(startOffset, true, false).equals(myRangeMarkerStartPosition) &&
if ((myRangeMarkerStartPosition == null ||
!myEditor.offsetToVisualPosition(startOffset, true, false).equals(myRangeMarkerStartPosition)) &&
model.getSoftWrap(startOffset) == null && !inlayModel.hasInlineElementAt(startOffset) ||
!myEditor.offsetToVisualPosition(endOffset, false, true).equals(myRangeMarkerEndPosition)
(myRangeMarkerEndPosition == null ||
!myEditor.offsetToVisualPosition(endOffset, false, true).equals(myRangeMarkerEndPosition))
&& model.getSoftWrap(endOffset) == null && !inlayModel.hasInlineElementAt(endOffset)) {
myRangeMarkerStartPosition = null;
myRangeMarkerEndPosition = null;