diff options
author | Roopesh Chander <roop@forwardbias.in> | 2009-10-04 00:42:02 +0530 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-02-08 16:59:10 +0100 |
commit | 764245eed27dd3b9c558580a4b33f4d2a8f430ee (patch) | |
tree | 8dba21ca769cd4f009c2a7b8c42cc53bc24b46a7 /src/plugins | |
parent | 6fced0e5b02473d916f053184f1279c12d2034b7 (diff) | |
download | qt-creator-764245eed27dd3b9c558580a4b33f4d2a8f430ee.tar.gz |
don't go searching backwards for more than a hundred lines of code
Merge-request: 1766
Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/texteditor/tabsettings.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index 890df01de4..10fe3bb49e 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -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; |