Commit 6afdb8bd authored by Serhii Moroz's avatar Serhii Moroz

TextEditor: Disable block selection if file was changed in other editor

Task-number: QTCREATORBUG-18770
Change-Id: Iccdc3deb354599bf1fd6f1cb8c0d5a1765ecb471
Reviewed-by: 's avatarDavid Schulz <david.schulz@qt.io>
parent 7d88284e
...@@ -1253,6 +1253,11 @@ void TextEditorWidgetPrivate::editorContentsChange(int position, int charsRemove ...@@ -1253,6 +1253,11 @@ void TextEditorWidgetPrivate::editorContentsChange(int position, int charsRemove
// lines were inserted or removed from outside, keep viewport on same part of text // lines were inserted or removed from outside, keep viewport on same part of text
if (q->firstVisibleBlock().blockNumber() > posBlock.blockNumber()) if (q->firstVisibleBlock().blockNumber() > posBlock.blockNumber())
q->verticalScrollBar()->setValue(q->verticalScrollBar()->value() + newBlockCount - m_blockCount); q->verticalScrollBar()->setValue(q->verticalScrollBar()->value() + newBlockCount - m_blockCount);
if (m_inBlockSelectionMode) {
disableBlockSelection(CursorUpdateClearSelection);
q->viewport()->update();
}
} }
m_blockCount = newBlockCount; m_blockCount = newBlockCount;
m_scrollBarUpdateTimer.start(500); m_scrollBarUpdateTimer.start(500);
......
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