forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.6'
Conflicts: src/plugins/coreplugin/locator/locator.cpp src/plugins/imageviewer/imageviewerplugin.cpp src/plugins/remotelinux/remotelinuxplugin.cpp src/tools/clangbackend/source/tokeninfo.cpp tests/unit/unittest/data/highlightingmarks.cpp Change-Id: I74cc3ba3a2836cb9d0e65d3380d8c4f88d720c67
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QStringList>
|
||||
#include <QTextBlock>
|
||||
|
||||
using namespace ClangCodeModel;
|
||||
using namespace ClangCodeModel::Internal;
|
||||
@@ -190,5 +191,15 @@ void setLastSentDocumentRevision(const QString &filePath, uint revision)
|
||||
document->sendTracker().setLastSentRevision(int(revision));
|
||||
}
|
||||
|
||||
int clangColumn(const QTextBlock &line, int cppEditorColumn)
|
||||
{
|
||||
// (1) cppEditorColumn is the actual column shown by CppEditor.
|
||||
// (2) The return value is the column in Clang which is the utf8 byte offset from the beginning
|
||||
// of the line.
|
||||
// Here we convert column from (1) to (2).
|
||||
// '+ 1' is for 1-based columns
|
||||
return line.text().left(cppEditorColumn).toUtf8().size() + 1;
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
} // namespace Clang
|
||||
|
||||
Reference in New Issue
Block a user