From b070eaad45cd7a153af7009d7cade283aca0d3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Tue, 5 May 2020 16:56:43 +0200 Subject: [PATCH] [apps/code] Remove double call to addAutocompletion --- apps/code/python_text_area.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/code/python_text_area.cpp b/apps/code/python_text_area.cpp index dff91f6f3..821895b2b 100644 --- a/apps/code/python_text_area.cpp +++ b/apps/code/python_text_area.cpp @@ -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); } }