diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index d5e79753b..d580a251f 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -2040,7 +2040,7 @@ bool NppParameters::getSessionFromXmlTree(TiXmlDocument *pSessionDoc, Session *p (childNode->ToElement())->Attribute(TEXT("endPos"), &position._endPos); (childNode->ToElement())->Attribute(TEXT("selMode"), &position._selMode); (childNode->ToElement())->Attribute(TEXT("scrollWidth"), &position._scrollWidth); - (childNode->ToElement())->Attribute(TEXT("offset"), &position._offset); + MapPosition mapPosition; int32_t mapPosVal; const TCHAR *mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapFirstVisibleDisplayLine"), &mapPosVal); diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 43af6f6d6..d1fbec616 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -134,7 +134,6 @@ struct Position int _xOffset = 0; int _selMode = 0; int _scrollWidth = 1; - int _offset = 0; }; diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 575d002a6..46586a1d9 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1755,7 +1755,7 @@ void ScintillaEditView::saveCurrentPos() //Save data so, that the current topline becomes visible again after restoring. int32_t displayedLine = static_cast(execute(SCI_GETFIRSTVISIBLELINE)); int32_t docLine = static_cast(execute(SCI_DOCLINEFROMVISIBLE, displayedLine)); //linenumber of the line displayed in the top - int32_t offset = displayedLine - static_cast(execute(SCI_VISIBLEFROMDOCLINE, docLine)); //use this to calc offset of wrap. If no wrap this should be zero + //int offset = displayedLine - execute(SCI_VISIBLEFROMDOCLINE, docLine); //use this to calc offset of wrap. If no wrap this should be zero Buffer * buf = MainFileManager->getBufferByID(_currentBufferID); @@ -1767,7 +1767,6 @@ void ScintillaEditView::saveCurrentPos() pos._xOffset = static_cast(execute(SCI_GETXOFFSET)); pos._selMode = static_cast(execute(SCI_GETSELECTIONMODE)); pos._scrollWidth = static_cast(execute(SCI_GETSCROLLWIDTH)); - pos._offset = offset; buf->setPosition(pos, this); } @@ -1789,11 +1788,8 @@ void ScintillaEditView::restoreCurrentPos() execute(SCI_SETXOFFSET, pos._xOffset); } execute(SCI_CHOOSECARETX); // choose current x position - execute(SCI_ENSUREVISIBLE); //Make sure the caret is visible (this will also fix wrapping problems) int lineToShow = static_cast(execute(SCI_VISIBLEFROMDOCLINE, pos._firstVisibleLine)); - lineToShow += pos._offset; - scroll(0, lineToShow); }