Commit b36924c0 authored by Takumi ASAKI's avatar Takumi ASAKI Committed by David Schulz

CppEditor: Fix inserting completion while in (local) rename mode

Fixes case 1 of QTCREATORBUG-14633.

Task-number: QTCREATORBUG-14633
Change-Id: I1f57b8f831613668b85948f4ec588c4cf441b633
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent 5088f07f
......@@ -723,6 +723,14 @@ FollowSymbolUnderCursor *CppEditorWidget::followSymbolUnderCursorDelegate()
return d->m_followSymbolUnderCursor.data();
}
void CppEditorWidget::encourageApply()
{
if (d->m_localRenaming.encourageApply())
return;
TextEditorWidget::encourageApply();
}
void CppEditorWidget::abortDeclDefLink()
{
if (!d->m_declDefLink)
......
......@@ -83,6 +83,8 @@ public:
FollowSymbolUnderCursor *followSymbolUnderCursorDelegate(); // exposed for tests
void encourageApply() override;
public slots:
void paste() override;
void cut() override;
......
......@@ -210,6 +210,14 @@ bool CppLocalRenaming::handleKeyPressEvent(QKeyEvent *e)
return true;
}
bool CppLocalRenaming::encourageApply()
{
if (!isActive())
return false;
finishRenameChange();
return true;
}
QTextEdit::ExtraSelection &CppLocalRenaming::renameSelection()
{
return m_selections[m_renameSelectionIndex];
......
......@@ -61,6 +61,8 @@ public:
// to BaseTextEditorWidget::keyPressEvent()
bool handleKeyPressEvent(QKeyEvent *e);
bool encourageApply();
public slots:
void updateSelectionsForVariableUnderCursor(const QList<QTextEdit::ExtraSelection> &selections);
......
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