forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.5'
Change-Id: I9baaf42531c10c32a2fa78d2504de213e77fdf82
This commit is contained in:
@@ -2532,7 +2532,7 @@ void TextEditorWidget::doSetTextCursor(const QTextCursor &cursor)
|
||||
void TextEditorWidget::gotoLine(int line, int column, bool centerLine)
|
||||
{
|
||||
d->m_lastCursorChangeWasInteresting = false; // avoid adding the previous position to history
|
||||
const int blockNumber = line - 1;
|
||||
const int blockNumber = qMin(line, document()->blockCount()) - 1;
|
||||
const QTextBlock &block = document()->findBlockByNumber(blockNumber);
|
||||
if (block.isValid()) {
|
||||
QTextCursor cursor(block);
|
||||
|
||||
Reference in New Issue
Block a user