Commit 70f6b107 authored by Erik Verbruggen's avatar Erik Verbruggen

C++ quickfixes: Improve function change tracking.

Now the (new or changed) return type is also tracked if the user starts
to type it as a prefix of the function name (followed by some white
space).
Done-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
Change-Id: I902132d5dd8fedcf430c43e9780428825f8ccada
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent c50c4269
......@@ -2244,10 +2244,12 @@ void CPPEditorWidget::updateFunctionDeclDefLink()
const int pos = textCursor().selectionStart();
// if there's already a link, abort it if the cursor is outside or the name changed
// (adding a prefix is an exception since the user might type a return type)
if (m_declDefLink
&& (pos < m_declDefLink->linkSelection.selectionStart()
|| pos > m_declDefLink->linkSelection.selectionEnd()
|| m_declDefLink->nameSelection.selectedText() != m_declDefLink->nameInitial)) {
|| !m_declDefLink->nameSelection.selectedText().trimmed()
.endsWith(m_declDefLink->nameInitial))) {
abortDeclDefLink();
return;
}
......
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