Esempio n. 1
0
 private void onTextLayoutPerformed(int startOffset, int endOffset) {
   if (checkDirty()) return;
   boolean purePaintingMode = myEditor.isPurePaintingMode();
   boolean foldingEnabled = myEditor.getFoldingModel().isFoldingEnabled();
   myEditor.setPurePaintingMode(false);
   myEditor.getFoldingModel().setFoldingEnabled(true);
   try {
     int startVisualLine = myView.offsetToVisualLine(startOffset, false);
     int endVisualLine = myView.offsetToVisualLine(endOffset, true);
     boolean sizeInvalidated = false;
     for (int i = startVisualLine; i <= endVisualLine; i++) {
       if (myLineWidths.get(i) < 0) {
         myLineWidths.set(i, UNKNOWN_WIDTH);
         sizeInvalidated = true;
       }
     }
     if (sizeInvalidated) {
       myWidthInPixels = -1;
       myEditor.getContentComponent().revalidate();
     }
   } finally {
     myEditor.setPurePaintingMode(purePaintingMode);
     myEditor.getFoldingModel().setFoldingEnabled(foldingEnabled);
   }
 }
 @Override
 public void setPurePaintingMode(boolean enabled) {
   myDelegate.setPurePaintingMode(enabled);
 }