Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ef833690
Commit
ef833690
authored
Jun 01, 2010
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check the current under cursor before searching for the enclosing expression.
parent
619d50f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
src/plugins/cppeditor/cppeditor.cpp
src/plugins/cppeditor/cppeditor.cpp
+11
-2
No files found.
src/plugins/cppeditor/cppeditor.cpp
View file @
ef833690
...
...
@@ -585,6 +585,11 @@ struct FindCanonicalSymbol
return
typeOfExpression
.
context
();
}
inline
bool
isIdentifierChar
(
const
QChar
&
ch
)
const
{
return
ch
.
isLetterOrNumber
()
||
ch
==
QLatin1Char
(
'_'
);
}
Symbol
*
operator
()(
const
QTextCursor
&
cursor
)
{
if
(
!
info
.
doc
)
...
...
@@ -598,8 +603,12 @@ struct FindCanonicalSymbol
QTextDocument
*
document
=
editor
->
document
();
int
pos
=
tc
.
position
();
while
(
document
->
characterAt
(
pos
).
isLetterOrNumber
()
||
document
->
characterAt
(
pos
)
==
QLatin1Char
(
'_'
))
if
(
!
isIdentifierChar
(
document
->
characterAt
(
pos
)))
if
(
!
(
pos
>
0
&&
isIdentifierChar
(
document
->
characterAt
(
pos
-
1
))))
return
0
;
while
(
isIdentifierChar
(
document
->
characterAt
(
pos
)))
++
pos
;
tc
.
setPosition
(
pos
);
...
...
Write
Preview
Markdown
is supported
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