Commit 764245ee authored by Roopesh Chander's avatar Roopesh Chander Committed by Thorbjørn Lindeijer
Browse files

don't go searching backwards for more than a hundred lines of code



Merge-request: 1766
Reviewed-by: default avatarThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
parent 6fced0e5
......@@ -231,7 +231,8 @@ bool TabSettings::guessSpacesForTabs(const QTextBlock& _block) const {
if (m_autoSpacesForTabs && _block.isValid()) {
QTextBlock block = _block;
const QTextDocument* doc = block.document();
while (block.isValid() && block != doc->begin()) {
int maxLookBack = 100;
while (block.isValid() && block != doc->begin() && maxLookBack-- > 0) {
block = block.previous();
if (block.text().isEmpty())
continue;
......
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