diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 8ca868ad75d03907eff91a5399ac5d0a4516c27b..3544cf3f2d33345e9bdc0435b4a6414f1a3e5bca 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -604,6 +604,13 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor, QTextCursor tc = cursor; + // Make sure we're not at the start of a word + { + const QChar c = characterAt(tc.position()); + if (c.isLetter() || c == QLatin1Char('_')) + tc.movePosition(QTextCursor::Right); + } + static TokenUnderCursor tokenUnderCursor; QTextBlock block;