diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index 6836b290..e99d7a18 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -948,14 +948,8 @@ BOOL Notepad_plus::notify(SCNotification *notification) // Check if a restore position is needed. // Restoring a position must done after SCN_PAINTED notification so that it works in every circumstances (including wrapped large file) - if (_mainEditView.isPositionRestoreNeeded()) - { - _mainEditView.restoreCurrentPosPostStep(); - } - if (_subEditView.isPositionRestoreNeeded()) - { - _subEditView.restoreCurrentPosPostStep(); - } + _mainEditView.restoreCurrentPosPostStep(); + _subEditView.restoreCurrentPosPostStep(); // ViewMoveAtWrappingDisableFix: Disable wrapping messes up visible lines. // Therefore save view position before in IDM_VIEW_WRAP and restore after SCN_PAINTED, as doc. says diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index a08a012b..a4d970cd 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1846,6 +1846,9 @@ void ScintillaEditView::restoreCurrentPosPreStep() // to scroll several lines to set the first visible line to the correct wrapped line. void ScintillaEditView::restoreCurrentPosPostStep() { + if (!_positionRestoreNeeded) + return; + static int32_t restoreDone = 0; Buffer * buf = MainFileManager.getBufferByID(_currentBufferID); Position & pos = buf->getPosition(this); diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 2f4b4b53..1ea1b99e 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -633,8 +633,6 @@ public: void setTabSettings(Lang *lang); bool isWrapRestoreNeeded() const {return _wrapRestoreNeeded;}; void setWrapRestoreNeeded(bool isWrapRestoredNeeded) {_wrapRestoreNeeded = isWrapRestoredNeeded;}; - bool isPositionRestoreNeeded() const {return _positionRestoreNeeded;}; - bool isCJK() const { return ((_codepage == CP_CHINESE_TRADITIONAL) || (_codepage == CP_CHINESE_SIMPLIFIED) ||