Fixed navigation with F2 when at the start of a word

Reviewed-by: con
This commit is contained in:
Thorbjørn Lindeijer
2009-04-21 15:32:50 +02:00
parent 57bf55dec9
commit b6d7fecf80

View File

@@ -604,6 +604,13 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
QTextCursor tc = 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; static TokenUnderCursor tokenUnderCursor;
QTextBlock block; QTextBlock block;