forked from qt-creator/qt-creator
DiffEditor: When jumping to a file then put that block to the top
When jumping to a file via the dropdown box: Have that block be scrolled to the top of the view, not to the center. This is way less confusing. Change-Id: I5c629dda1af8bff76ca93a70357aa35c8efcb37a Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <QPlainTextEdit>
|
||||
#include <QMenu>
|
||||
#include <QPlainTextDocumentLayout>
|
||||
#include <QScrollBar>
|
||||
#include <QTextBlock>
|
||||
#include <QTextCodec>
|
||||
#include <QPainter>
|
||||
@@ -734,7 +735,7 @@ void UnifiedDiffEditorWidget::setCurrentDiffFileIndex(int diffFileIndex)
|
||||
QTextCursor cursor = textCursor();
|
||||
cursor.setPosition(block.position());
|
||||
setTextCursor(cursor);
|
||||
centerCursor();
|
||||
verticalScrollBar()->setValue(blockNumber);
|
||||
m_ignoreCurrentIndexChange = oldIgnore;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user