[poincare/parser] Add context

This commit is contained in:
Léa Saviot
2020-01-16 11:13:22 +01:00
parent 158a45e94d
commit 756eeeb2d8
38 changed files with 182 additions and 156 deletions

View File

@@ -139,13 +139,14 @@ bool EditExpressionController::inputViewDidReceiveEvent(Ion::Events::Event event
bool EditExpressionController::inputViewDidFinishEditing(const char * text, Layout layoutR) {
Context * context = textFieldDelegateApp()->localContext();
if (layoutR.isUninitialized()) {
assert(text);
strlcpy(m_cacheBuffer, text, k_cacheBufferSize);
} else {
layoutR.serializeParsedExpression(m_cacheBuffer, k_cacheBufferSize);
layoutR.serializeParsedExpression(m_cacheBuffer, k_cacheBufferSize, context);
}
m_calculationStore->push(m_cacheBuffer, textFieldDelegateApp()->localContext());
m_calculationStore->push(m_cacheBuffer, context);
m_historyController->reload();
m_contentView.expressionField()->setEditing(true, true);
return true;