Simplefy the commit 9387dcdaef

This commit is contained in:
Don HO 2020-01-06 13:40:49 +01:00
parent 563530379f
commit 062ec3e726
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
3 changed files with 5 additions and 10 deletions

View File

@ -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

View File

@ -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);

View File

@ -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) ||