forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Thorbjørn Lindeijer
parent
6fced0e5b0
commit
764245eed2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user