mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-64648 Soft wraps:Throwable at CaretModelImpl.moveToOffset() and visual defects on resizing editor after font has been changed via Ctrl+Scroll
Dropping cached mappings like 'font type -> space size' on editor font size change
This commit is contained in:
@@ -32,6 +32,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.*;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@@ -48,7 +50,7 @@ import java.util.List;
|
||||
* @author Denis Zhdanov
|
||||
* @since Jun 8, 2010 12:47:32 PM
|
||||
*/
|
||||
public class SoftWrapModelImpl implements SoftWrapModelEx, PrioritizedDocumentListener, FoldingListener {
|
||||
public class SoftWrapModelImpl implements SoftWrapModelEx, PrioritizedDocumentListener, FoldingListener, PropertyChangeListener {
|
||||
|
||||
/**
|
||||
* Holds name of JVM property which presence should trigger debug-aware soft wraps processing.
|
||||
@@ -155,6 +157,8 @@ public class SoftWrapModelImpl implements SoftWrapModelEx, PrioritizedDocumentLi
|
||||
EditorSettings settings = myEditor.getSettings();
|
||||
myAdditionalColumnsCount = settings.getAdditionalColumnsCount();
|
||||
myUseSoftWraps = settings.isUseSoftWraps();
|
||||
|
||||
editor.addPropertyChangeListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -582,6 +586,13 @@ public class SoftWrapModelImpl implements SoftWrapModelEx, PrioritizedDocumentLi
|
||||
executeSafely(myFoldProcessingEndTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (EditorEx.PROP_FONT_SIZE.equals(evt.getPropertyName())) {
|
||||
myDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
myDataMapper.release();
|
||||
|
||||
+14
@@ -34,6 +34,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -834,6 +835,12 @@ public class SoftWrapApplianceManager implements FoldingListener, DocumentListen
|
||||
indentInColumns = 0;
|
||||
indentInPixels = 0;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
indentInColumns = 0;
|
||||
indentInPixels = 0;
|
||||
endLineOffset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void setWidthProvider(VisibleAreaWidthProvider widthProvider) {
|
||||
@@ -993,6 +1000,8 @@ public class SoftWrapApplianceManager implements FoldingListener, DocumentListen
|
||||
fontType = 0;
|
||||
notifyListenersOnLineStartPosition = false;
|
||||
skipToLineEnd = false;
|
||||
fontType2spaceWidth.reset();
|
||||
logicalLineData.reset();
|
||||
}
|
||||
|
||||
public int getSpaceWidth() {
|
||||
@@ -1149,5 +1158,10 @@ public class SoftWrapApplianceManager implements FoldingListener, DocumentListen
|
||||
}
|
||||
myData[index] = value;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
myShift = 0;
|
||||
Arrays.fill(myData, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user