Commit 37973823 authored by con's avatar con

One step to being able to jump back in a senseful way...

parent fc79c737
......@@ -959,7 +959,7 @@ void BaseTextEditor::setTextCursor(const QTextCursor &cursor)
slotSelectionChanged();
}
void BaseTextEditor::gotoLine(int line, int column, bool saveNewPosition)
void BaseTextEditor::gotoLine(int line, int column)
{
const int blockNumber = line - 1;
const QTextBlock &block = document()->findBlockByNumber(blockNumber);
......@@ -977,8 +977,7 @@ void BaseTextEditor::gotoLine(int line, int column, bool saveNewPosition)
setTextCursor(cursor);
centerCursor();
}
if (saveNewPosition)
saveCurrentCursorPositionForNavigation();
saveCurrentCursorPositionForNavigation();
}
int BaseTextEditor::position(ITextEditor::PositionOperation posOp, int at) const
......@@ -1115,9 +1114,11 @@ bool BaseTextEditor::restoreState(const QByteArray &state)
stream >> hval;
stream >> lval;
stream >> cval;
gotoLine(lval, cval, false);
d->m_lastCursorChangeWasInteresting = false; // avoid adding last position to history
gotoLine(lval, cval);
verticalScrollBar()->setValue(vval);
horizontalScrollBar()->setValue(hval);
saveCurrentCursorPositionForNavigation();
return true;
}
......
......@@ -241,7 +241,7 @@ public:
// ITextEditor
void gotoLine(int line, int column = 0, bool saveNewPosition = true);
void gotoLine(int line, int column = 0);
int position(
ITextEditor::PositionOperation posOp = ITextEditor::Current
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment