---
title: "editor.formula: Type in the Formula Bar — Sheet kit command — Kition"
description: "Types in the formula bar: the text becomes the active cell's typing (started from what the cell holds), so the cell shows it and pointing at cells inserts their references at the caret. With enter, enters it as Enter (down), Shift+Enter (up), Tab (right), Shift+Tab (left) or the check button (stay) do. With peek, changes nothing. With no params, drops the typing as Escape does. Answers the typing, its selection, its references and the function list and argument hint at the caret. Offsets are UTF-16."
canonical: "https://developer.kition.ai/docs/kits/sheet/commands/editor.formula"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/sheet/commands/editor.formula](https://developer.kition.ai/docs/kits/sheet/commands/editor.formula)

# editor.formula

**Type in the Formula Bar.** Types in the formula bar: the text becomes the active cell's typing (started from what the cell holds), so the cell shows it and pointing at cells inserts their references at the caret. With enter, enters it as Enter (down), Shift+Enter (up), Tab (right), Shift+Tab (left) or the check button (stay) do. With peek, changes nothing. With no params, drops the typing as Escape does. Answers the typing, its selection, its references and the function list and argument hint at the caret. Offsets are UTF-16.

- Kit: Sheet 0.1.0 (.xlsx (and opens .xlsm, .xls, .xltx, .csv, .ods, .xlsb)); reference: [Sheet kit commands](https://developer.kition.ai/docs/kits/sheet.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `end` | `number` | no | End of the selection (UTF-16 offset); default the end of the text |
| `enter` | `"down" \| "up" \| "right" \| "left" \| "stay"` | no | Enters the typing and moves the active cell |
| `peek` | `boolean` | no | true answers the typing without changing anything |
| `start` | `number` | no | Start of the selection (UTF-16 offset); default the end of the text |
| `text` | `string` | no | The formula bar's text |

## Call through sheet_run

```text
sheet_run {
  "path": "<file>.xlsx",
  "steps": [{ "command": "editor.formula" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `end`, `enter`, `peek`, `start`, `text`. sheet_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `editing` | `boolean` | no |  |
| `end` | `number` | no |  |
| `hint` | `null \| object` | no |  |
| `pointing` | `boolean` | no |  |
| `references` | `object[]` | no |  |
| `start` | `number` | no |  |
| `text` | `null \| string` | no |  |

```json
{
  "additionalProperties": false,
  "properties": {
    "editing": {
      "type": "boolean"
    },
    "end": {
      "type": "number"
    },
    "hint": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "pointing": {
      "type": "boolean"
    },
    "references": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "color": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "end": {
            "type": "number"
          },
          "start": {
            "type": "number"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "start": {
      "type": "number"
    },
    "text": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ]
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "end": {
      "description": "End of the selection (UTF-16 offset); default the end of the text",
      "type": "number"
    },
    "enter": {
      "description": "Enters the typing and moves the active cell",
      "enum": [
        "down",
        "up",
        "right",
        "left",
        "stay"
      ],
      "type": "string"
    },
    "peek": {
      "description": "true answers the typing without changing anything",
      "type": "boolean"
    },
    "start": {
      "description": "Start of the selection (UTF-16 offset); default the end of the text",
      "type": "number"
    },
    "text": {
      "description": "The formula bar's text",
      "type": "string"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/sheet-darwin-arm64@0.1.0 and the kit itself (sheet_commands through @kition/cli@0.1.1, built from KitionAI/kition-sheet@82f13b2).
