[apps/code] Autocomplete only after edition

Reverts 39c3d66cd
This commit is contained in:
Léa Saviot
2020-04-22 17:21:29 +02:00
committed by Émilie Feral
parent 4502ae4fbd
commit 9bf361d5a5

View File

@@ -245,8 +245,11 @@ bool PythonTextArea::handleEvent(Ion::Events::Event event) {
}
}
bool result = TextArea::handleEvent(event);
if (!m_contentView.isAutocompleting() && selectionIsEmpty()) {
// Add autocompletion after each event handled, if nothing is selected
if (event == Ion::Events::Backspace && !m_contentView.isAutocompleting() && selectionIsEmpty()) {
/* We want to add autocompletion when we are editing a word (after adding or
* deleting text). So if nothing is selected, we add the autocompletion if
* the event is backspace, as autocompletion has already been added if the
* event added text, in handleEventWithText. */
addAutocompletion();
}
return result;