public bool HandleKey(FormulaEditorKey key, LocalVariable localVariable = null, GlobalVariable globalVariable = null)
{
if (key == FormulaEditorKey.Delete)
{
PushUndo();
return Delete();
}
PushUndo();
var token = CreateToken(key, localVariable, globalVariable);
return Insert((token is IFormulaFunction)
? new[] { token, FormulaTokenFactory.CreateParenthesisToken(true) }
: new[] { token });
}