[apps/code] Autocomplete only with parentheses if needed

For instance, type "abs", there is "()" autocompletion
This commit is contained in:
Léa Saviot
2020-04-24 14:00:01 +02:00
committed by Émilie Feral
parent 5d2910188d
commit 94e9a10f16
3 changed files with 29 additions and 28 deletions

View File

@@ -361,6 +361,7 @@ void PythonTextArea::addAutocompletion() {
constexpr int parenthesesLength = 2;
assert(strlen(parentheses) == parenthesesLength);
if (addParentheses && m_contentView.insertTextAtLocation(ScriptNodeCell::k_parentheses, const_cast<char *>(autocompletionLocation), parenthesesLength)) {
m_contentView.setAutocompleting(true);
m_contentView.setAutocompletionEnd(autocompletionLocation + parenthesesLength);
}
}