forked from qt-creator/qt-creator
CppEditor: Fix inserting completion while in (local) rename mode
Fixes case 1 of QTCREATORBUG-14633. Task-number: QTCREATORBUG-14633 Change-Id: I1f57b8f831613668b85948f4ec588c4cf441b633 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
committed by
David Schulz
parent
5088f07f39
commit
b36924c0e6
@@ -723,6 +723,14 @@ FollowSymbolUnderCursor *CppEditorWidget::followSymbolUnderCursorDelegate()
|
|||||||
return d->m_followSymbolUnderCursor.data();
|
return d->m_followSymbolUnderCursor.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CppEditorWidget::encourageApply()
|
||||||
|
{
|
||||||
|
if (d->m_localRenaming.encourageApply())
|
||||||
|
return;
|
||||||
|
|
||||||
|
TextEditorWidget::encourageApply();
|
||||||
|
}
|
||||||
|
|
||||||
void CppEditorWidget::abortDeclDefLink()
|
void CppEditorWidget::abortDeclDefLink()
|
||||||
{
|
{
|
||||||
if (!d->m_declDefLink)
|
if (!d->m_declDefLink)
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ public:
|
|||||||
|
|
||||||
FollowSymbolUnderCursor *followSymbolUnderCursorDelegate(); // exposed for tests
|
FollowSymbolUnderCursor *followSymbolUnderCursorDelegate(); // exposed for tests
|
||||||
|
|
||||||
|
void encourageApply() override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void paste() override;
|
void paste() override;
|
||||||
void cut() override;
|
void cut() override;
|
||||||
|
|||||||
@@ -210,6 +210,14 @@ bool CppLocalRenaming::handleKeyPressEvent(QKeyEvent *e)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CppLocalRenaming::encourageApply()
|
||||||
|
{
|
||||||
|
if (!isActive())
|
||||||
|
return false;
|
||||||
|
finishRenameChange();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
QTextEdit::ExtraSelection &CppLocalRenaming::renameSelection()
|
QTextEdit::ExtraSelection &CppLocalRenaming::renameSelection()
|
||||||
{
|
{
|
||||||
return m_selections[m_renameSelectionIndex];
|
return m_selections[m_renameSelectionIndex];
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ public:
|
|||||||
// to BaseTextEditorWidget::keyPressEvent()
|
// to BaseTextEditorWidget::keyPressEvent()
|
||||||
bool handleKeyPressEvent(QKeyEvent *e);
|
bool handleKeyPressEvent(QKeyEvent *e);
|
||||||
|
|
||||||
|
bool encourageApply();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateSelectionsForVariableUnderCursor(const QList<QTextEdit::ExtraSelection> &selections);
|
void updateSelectionsForVariableUnderCursor(const QList<QTextEdit::ExtraSelection> &selections);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user