summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2010-07-08 14:16:58 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2010-07-08 14:20:30 +0200
commitdb9b630b48472c097549d5feeb0b367878c04bb9 (patch)
treec8eef8eb3a86ab4bd3563e648cb76b0da6daa3a0 /src
parent02923cf2580ece7f1680059a3ed99f326b5dc724 (diff)
downloadqt-creator-db9b630b48472c097549d5feeb0b367878c04bb9.tar.gz
Qml scanner: Fix begin location of comment tokens in multiline comments.
Done-with: Thomas Hartmann Reviewed-by: Roberto Raggi
Diffstat (limited to 'src')
-rw-r--r--src/libs/qmljs/qmljsscanner.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libs/qmljs/qmljsscanner.cpp b/src/libs/qmljs/qmljsscanner.cpp
index 9a629db9a9..3e7bb7e426 100644
--- a/src/libs/qmljs/qmljsscanner.cpp
+++ b/src/libs/qmljs/qmljsscanner.cpp
@@ -130,9 +130,13 @@ QList<Token> 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);