Fix auto scroll to last line after update not working

This fix comes from the suggestion of this thread:
https://github.com/notepad-plus-plus/notepad-plus-plus/pull/8782#issuecomment-690752536

Fix #8477, fix #8214
This commit is contained in:
Don HO 2020-09-11 16:05:06 +02:00
parent 009563f52d
commit c607e427fc
3 changed files with 5 additions and 3 deletions

View File

@ -3865,11 +3865,13 @@ void Notepad_plus::performPostReload(int whichOne)
return;
if (whichOne == MAIN_VIEW)
{
_mainEditView.execute(SCI_GOTOLINE, _mainEditView.execute(SCI_GETLINECOUNT) -1);
_mainEditView.setPositionRestoreNeeded(false);
_mainEditView.execute(SCI_DOCUMENTEND);
}
else
{
_subEditView.execute(SCI_GOTOLINE, _subEditView.execute(SCI_GETLINECOUNT) -1);
_subEditView.setPositionRestoreNeeded(false);
_subEditView.execute(SCI_DOCUMENTEND);
}
}

View File

@ -646,7 +646,7 @@ public:
void sortLines(size_t fromLine, size_t toLine, ISorter *pSort);
void changeTextDirection(bool isRTL);
bool isTextDirectionRTL() const;
void setPositionRestoreNeeded(bool val) { _positionRestoreNeeded = val; };
protected:
static HINSTANCE _hLib;
static int _refCount;