Commit cd638b98 authored by con's avatar con
Browse files

Keep cursor position and scroll state when reloading text editors.

Regression coming from the new navigation history mechanism.
parent 9867b7b5
......@@ -2328,13 +2328,13 @@ void BaseTextEditor::slotUpdateRequest(const QRect &r, int dy)
void BaseTextEditor::saveCurrentCursorPositionForNavigation()
{
d->m_lastCursorChangeWasInteresting = true;
d->m_tempState = saveState();
d->m_tempNavigationState = saveState();
}
void BaseTextEditor::slotCursorPositionChanged()
{
if (!d->m_contentsChanged && d->m_lastCursorChangeWasInteresting) {
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory(d->m_tempState);
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory(d->m_tempNavigationState);
d->m_lastCursorChangeWasInteresting = false;
} else if (d->m_contentsChanged) {
saveCurrentCursorPositionForNavigation();
......
......@@ -147,6 +147,7 @@ public:
QRefCountPointer<BaseTextDocument> m_document;
QByteArray m_tempState;
QByteArray m_tempNavigationState;
QString m_displayName;
bool m_parenthesesMatchingEnabled;
......
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