diff options
-rw-r--r-- | src/plugins/cppeditor/cppeditor.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 8ca868ad75..3544cf3f2d 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; |