From db9b630b48472c097549d5feeb0b367878c04bb9 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 8 Jul 2010 14:16:58 +0200 Subject: [PATCH] Qml scanner: Fix begin location of comment tokens in multiline comments. Done-with: Thomas Hartmann Reviewed-by: Roberto Raggi --- src/libs/qmljs/qmljsscanner.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/qmljs/qmljsscanner.cpp b/src/libs/qmljs/qmljsscanner.cpp index 9a629db9a91..3e7bb7e426d 100644 --- a/src/libs/qmljs/qmljsscanner.cpp +++ b/src/libs/qmljs/qmljsscanner.cpp @@ -130,9 +130,13 @@ QList Scanner::operator()(const QString &text, int startState) int index = 0; if (_state == MultiLineComment) { - const int start = index; + int start = -1; while (index < text.length()) { const QChar ch = text.at(index); + + if (start == -1 && !ch.isSpace()) + start = index; + QChar la; if (index + 1 < text.length()) la = text.at(index + 1);