forked from qt-creator/qt-creator
One step to being able to jump back in a senseful way...
This commit is contained in:
@@ -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,7 +977,6 @@ void BaseTextEditor::gotoLine(int line, int column, bool saveNewPosition)
|
||||
setTextCursor(cursor);
|
||||
centerCursor();
|
||||
}
|
||||
if (saveNewPosition)
|
||||
saveCurrentCursorPositionForNavigation();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user