Commit 5852cc80 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

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

Reviewed by: Roberto Raggi
parent 1bb9a245
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment