forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.8'
Conflicts: src/plugins/android/androidrunnerworker.cpp Change-Id: Ibd8b99435365fb7e7d488313fd1d2b3a75adad1b
This commit is contained in:
@@ -136,7 +136,7 @@ CppTools::CheckSymbols *createHighlighter(const CPlusPlus::Document::Ptr &doc,
|
||||
|
||||
int line, column;
|
||||
convertPosition(textDocument, macro.utf16charsBegin(), &line, &column);
|
||||
++column; //Highlighting starts at (column-1) --> compensate here
|
||||
|
||||
Result use(line, column, name.size(), SemanticHighlighter::MacroUse);
|
||||
macroUses.append(use);
|
||||
}
|
||||
|
||||
@@ -235,14 +235,15 @@ static int lastIncludeIndex(const QStringList &options, const QRegularExpression
|
||||
|
||||
static int includeIndexForResourceDirectory(const QStringList &options, bool isMacOs = false)
|
||||
{
|
||||
// include/c++/{version}, include/c++/v1 and include/g++
|
||||
static const QRegularExpression includeRegExp(
|
||||
R"(\A.*[\/\\]include[\/\\].*(g\+\+.*\z|c\+\+[\/\\](v1\z|\d+.*\z)))");
|
||||
// include/c++, include/g++, libc++\include and libc++abi\include
|
||||
static const QString cppIncludes = R"((.*[\/\\]include[\/\\].*(g\+\+|c\+\+).*))"
|
||||
R"(|(.*libc\+\+[\/\\]include))"
|
||||
R"(|(.*libc\+\+abi[\/\\]include))";
|
||||
static const QRegularExpression includeRegExp("\\A(" + cppIncludes + ")\\z");
|
||||
|
||||
// The same as includeRegExp but also matches /usr/local/include
|
||||
static const QRegularExpression includeRegExpMac(
|
||||
R"(\A(.*[\/\\]include[\/\\].*(g\+\+.*\z|c\+\+[\/\\](v1\z|\d+.*\z))))"
|
||||
R"(|([\/\\]usr[\/\\]local[\/\\]include\z))");
|
||||
"\\A(" + cppIncludes + R"(|([\/\\]usr[\/\\]local[\/\\]include))" + ")\\z");
|
||||
|
||||
const int cppIncludeIndex = lastIncludeIndex(options, isMacOs
|
||||
? includeRegExpMac
|
||||
|
||||
@@ -491,10 +491,13 @@ void FollowSymbolUnderCursor::findLink(
|
||||
{
|
||||
Link link;
|
||||
|
||||
int line = 0;
|
||||
int column = 0;
|
||||
QTextCursor cursor = data.cursor();
|
||||
QTextDocument *document = cursor.document();
|
||||
if (!document)
|
||||
return processLinkCallback(link);
|
||||
|
||||
int line = 0;
|
||||
int column = 0;
|
||||
Utils::Text::convertPosition(document, cursor.position(), &line, &column);
|
||||
const int positionInBlock = column - 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user