diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2010-07-08 14:16:58 +0200 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2010-07-08 14:20:30 +0200 |
commit | db9b630b48472c097549d5feeb0b367878c04bb9 (patch) | |
tree | c8eef8eb3a86ab4bd3563e648cb76b0da6daa3a0 /src | |
parent | 02923cf2580ece7f1680059a3ed99f326b5dc724 (diff) | |
download | qt-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.cpp | 6 |
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); |