Fixed refactoring when the cursor is at the end of a symbol.

Reviewed by: Roberto Raggi
This commit is contained in:
Erik Verbruggen
2009-10-08 14:26:54 +02:00
parent 1bb9a24517
commit 5852cc805d

View File

@@ -831,9 +831,13 @@ CPlusPlus::Symbol *CPPEditor::findCanonicalSymbol(const QTextCursor &cursor,
QTextCursor tc = cursor;
int line, col;
convertPosition(tc.position(), &line, &col);
++col;
++col; // 1-based line and 1-based column
tc.movePosition(QTextCursor::EndOfWord);
int pos = tc.position();
while (document()->characterAt(pos).isLetterOrNumber() ||
document()->characterAt(pos) == QLatin1Char('_'))
++pos;
tc.setPosition(pos);
ExpressionUnderCursor expressionUnderCursor;
const QString code = expressionUnderCursor(tc);