# EditTextToolApi.commit()

```ts
commit(): Promise<void>
```

Writes every pending edit into the document and reports [textChanged](https://kernstra.com/docs/web-sdk/api/events#ev-textchanged). Deactivates the tool, as pressing Save in the toolbar does; re-activate before further edits, and re-read `listBlocks()` — every block id from before a commit is stale.

- Kind: method
- Since: 1.0.0

Returns `Promise<void>`

Throws:

- `INVALID_STATE` while the tool is not active — without `edit-text` it cannot be activated.

```ts
await viewer.tools.editText.commit();
```

Part of [EditTextToolApi](https://kernstra.com/docs/web-sdk/api/viewer-tools-edittext) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/viewer-tools-edittext/commit
