[apps/code] Use variable

This commit is contained in:
Léa Saviot
2020-04-24 17:00:16 +02:00
committed by Émilie Feral
parent 94e9a10f16
commit e7bfb3b5f3
2 changed files with 2 additions and 2 deletions

View File

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

View File

@@ -742,7 +742,7 @@ bool VariableBoxController::addNodesFromImportMaybe(mp_parse_node_struct_t * par
* and "....function". */
constexpr int numberOfNodesToSkip = 3;
assert(numberOfChildren > numberOfNodesToSkip);
for (int i = 3; i < numberOfChildren; i++) {
for (int i = numberOfNodesToSkip; i < numberOfChildren; i++) {
const char * name = I18n::translate((moduleChildren + i)->label());
checkAndAddNode(textToAutocomplete, textToAutocompleteLength, ScriptNode::Type::WithoutParentheses, NodeOrigin::Importation, name, -1, importationSourceName, I18n::translate((moduleChildren + i)->text()) /*TODO LEA text or label?*/);
}