DiffEditor: Fix scrolling to current file after reloading

This feature got broken during recent refactorings.

Change-Id: I9d2d24e7ed63d5512b64c53e4bb9303497871d5e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-09-29 11:35:17 +02:00
parent 1cf6b031cf
commit 67121e6cd3
3 changed files with 10 additions and 0 deletions

View File

@@ -132,6 +132,7 @@ void UnifiedDiffEditorWidget::slotCursorPositionChangedInEditor()
return;
const GuardLocker locker(m_controller.m_ignoreChanges);
m_controller.setCurrentDiffFileIndex(fileIndex);
emit currentDiffFileIndexChanged(fileIndex);
}
@@ -499,6 +500,7 @@ void UnifiedDiffEditorWidget::showDiff()
setReadOnly(true);
}
setSelections(result.selections);
setCurrentDiffFileIndex(m_controller.currentDiffFileIndex());
}
m_watcher.release()->deleteLater();
m_controller.setBusyShowing(false);
@@ -647,6 +649,7 @@ void UnifiedDiffEditorWidget::setCurrentDiffFileIndex(int diffFileIndex)
return;
const GuardLocker locker(m_controller.m_ignoreChanges);
m_controller.setCurrentDiffFileIndex(diffFileIndex);
const int blockNumber = blockNumberForFileIndex(diffFileIndex);
QTextBlock block = document()->findBlockByNumber(blockNumber);