Commit 03b626c8 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Move the cursor at the character before the delimiter.

parent 31703800
......@@ -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();
......
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