Keep cursor position and scroll state when reloading text editors.

Regression coming from the new navigation history mechanism.
This commit is contained in:
con
2009-04-02 17:56:20 +02:00
parent 9867b7b5e3
commit cd638b98bd
2 changed files with 3 additions and 2 deletions

View File

@@ -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();