[apps/code] Remove double call to addAutocompletion

This commit is contained in:
Léa Saviot
2020-05-05 16:56:43 +02:00
committed by Émilie Feral
parent c915eb0b27
commit b070eaad45

View File

@@ -412,11 +412,10 @@ void PythonTextArea::acceptAutocompletion(bool moveCursorToEndOfAutocompletion)
m_contentView.pythonDelegate()->variableBoxController()->setSender(this);
m_contentView.pythonDelegate()->variableBoxController()->insertAutocompletionResultAtIndex(m_autocompletionResultIndex);
/* Add the autocompletion if we moved the cursor. If we did not want to move
* the cursor, restore its position. */
if (moveCursorToEndOfAutocompletion) {
addAutocompletion();
} else {
// insertAutocompletionResultAtIndex already added the autocompletion
// If we did not want to move the cursor, restore its position.
if (!moveCursorToEndOfAutocompletion) {
setCursorLocation(previousCursorLocation);
}
}