From b61c37691497c3fb6c554122475138c302ba44ad Mon Sep 17 00:00:00 2001 From: mae Date: Wed, 14 Jul 2010 18:48:36 +0200 Subject: [PATCH] Fix findScope performance issue Fixes the performance of large find scope selections. Try Ctrl+A Ctrl+F in a large file and scroll. --- src/plugins/texteditor/texteditoroverlay.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index 331e449955e..20d38fae38a 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -138,6 +138,9 @@ QPainterPath TextEditorOverlay::createSelectionPath(const QTextCursor &begin, co QTextBlock block = begin.block(); + if (block.blockNumber() < m_editor->firstVisibleBlock().blockNumber() - 4) + block = m_editor->document()->findBlockByNumber(m_editor->firstVisibleBlock().blockNumber() - 4); + bool inSelection = false; QVector selection;