Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 5de035e7 authored by Sven Brauch's avatar Sven Brauch

cpp: completion: fix cursor placement when '(' is already there

parent 3bce40c4
......@@ -218,12 +218,14 @@ public:
}
}
bool didAddParentheses = false;
if ( !funcptr && doc->characterAt(word.end()) != QLatin1Char('(') ) {
repl += QLatin1String("()");
didAddParentheses = true;
}
view->document()->replaceText(word, repl);
auto f = m_declaration->type<FunctionType>();
if (f && f->indexedArgumentsSize()) {
if (f && f->indexedArgumentsSize() && didAddParentheses) {
view->setCursorPosition(word.start() + KTextEditor::Cursor(0, repl.size() - 1));
}
} else {
......
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