Skip to content
GitLab
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
03b626c8
Commit
03b626c8
authored
Aug 17, 2010
by
Roberto Raggi
Browse files
Move the cursor at the character before the delimiter.
parent
31703800
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
03b626c8
...
...
@@ -1226,7 +1226,11 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
if
(
!
recognizedQtMethod
)
{
const
QTextBlock
block
=
tc
.
block
();
const
Token
tk
=
SimpleLexer
::
tokenAt
(
block
.
text
(),
cursor
.
positionInBlock
(),
BackwardsScanner
::
previousBlockState
(
block
),
true
);
int
pos
=
cursor
.
positionInBlock
();
QChar
ch
=
document
()
->
characterAt
(
cursor
.
position
());
if
(
pos
>
0
&&
!
(
ch
.
isLetterOrNumber
()
||
ch
==
QLatin1Char
(
'_'
)))
--
pos
;
// positionInBlock points to a delimiter character.
const
Token
tk
=
SimpleLexer
::
tokenAt
(
block
.
text
(),
pos
,
BackwardsScanner
::
previousBlockState
(
block
),
true
);
beginOfToken
=
block
.
position
()
+
tk
.
begin
();
endOfToken
=
block
.
position
()
+
tk
.
end
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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