diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index fd52df566..a81e1f7db 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1646,6 +1646,10 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case WM_ACTIVATE: { _pEditView->getFocus(); + auto x = _pEditView->execute(SCI_GETXOFFSET); + _pEditView->execute(SCI_SETXOFFSET, x); + x = _pNonEditView->execute(SCI_GETXOFFSET); + _pNonEditView->execute(SCI_SETXOFFSET, x); return TRUE; } diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index bf4aca824..ba374160e 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -221,13 +221,14 @@ public: { ::DestroyWindow(_hSelf); _hSelf = NULL; + _pScintillaFunc = NULL; }; virtual void init(HINSTANCE hInst, HWND hPere); LRESULT execute(UINT Msg, WPARAM wParam=0, LPARAM lParam=0) const { try { - return _pScintillaFunc(_pScintillaPtr, Msg, wParam, lParam); + return (_pScintillaFunc) ? _pScintillaFunc(_pScintillaPtr, Msg, wParam, lParam) : -1; } catch (...) {