Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
de6166fc
Commit
de6166fc
authored
Mar 24, 2009
by
Thorbjørn Lindeijer
Browse files
Don't try to resolve plain literals or comments
There's no place to jump to in these cases.
parent
ed9df58a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
de6166fc
...
...
@@ -47,6 +47,7 @@
#include <cplusplus/Overview.h>
#include <cplusplus/OverviewModel.h>
#include <cplusplus/SimpleLexer.h>
#include <cplusplus/TokenUnderCursor.h>
#include <cplusplus/TypeOfExpression.h>
#include <cpptools/cppmodelmanagerinterface.h>
...
...
@@ -627,13 +628,15 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor)
tc
.
movePosition
(
QTextCursor
::
PreviousWord
,
QTextCursor
::
KeepAnchor
);
const
int
nameStart
=
tc
.
position
();
const
int
nameLength
=
tc
.
anchor
()
-
tc
.
position
();
tc
.
setPosition
(
endOfName
);
// Drop out if we're at a number
if
(
characterAt
(
nameStart
).
isNumber
())
// Drop out if we're at a number, string or comment
static
TokenUnderCursor
tokenUnderCursor
;
const
SimpleToken
tk
=
tokenUnderCursor
(
tc
);
if
(
tk
.
isLiteral
()
||
tk
.
isComment
())
return
link
;
// Evaluate the type of the expression under the cursor
tc
.
setPosition
(
endOfName
);
ExpressionUnderCursor
expressionUnderCursor
;
const
QString
expression
=
expressionUnderCursor
(
tc
);
TypeOfExpression
typeOfExpression
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment