IDEA-136798 Switching between editors does not restore scroll position properly when soft-wraps are involved

This commit is contained in:
Dmitry Batrak
2015-02-24 10:35:09 +03:00
parent 01077fc7e2
commit 6ca4b6b883
@@ -185,6 +185,7 @@ public class SoftWrapModelImpl implements SoftWrapModelEx, PrioritizedDocumentLi
if ((myUseSoftWraps ^ softWrapsUsedBefore) || (tabWidthBefore >= 0 && myTabWidth != tabWidthBefore) || fontsChanged) {
myApplianceManager.reset();
myDeferredFoldRegions.clear();
myStorage.removeAll();
myEditor.getScrollingModel().scrollToCaret(ScrollType.CENTER);
}
}
@@ -286,9 +287,6 @@ public class SoftWrapModelImpl implements SoftWrapModelEx, PrioritizedDocumentLi
* @return total number of soft wrap-introduced new visual lines
*/
public int getSoftWrapsIntroducedLinesNumber() {
if (!isSoftWrappingEnabled()) {
return 0;
}
return myStorage.getSoftWraps().size(); // Assuming that soft wrap has single line feed all the time
}