# Ability to update JSON arrays \(\#38087\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/99b71677c61588031bcb6b4c0543a2491962906f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 99b71677c61588031bcb6b4c0543a2491962906f

Requested commit: 99b71677c61588031bcb6b4c0543a2491962906f

Commit: 99b71677c61588031bcb6b4c0543a2491962906f

Tree: 34ba47484c834ca1884fdf5564f887067cc8fe99

Author: Ben Kunkle

Committer: GitHub

## Message

```
Ability to update JSON arrays (#38087)

Closes #ISSUE

Adds the ability to our JSON updating code to update arrays within other
objects. Previously updating of arrays was limited to just top level
arrays (i.e. `keymap.json`) however this PR makes it so nested arrays
are supported as well using `#{index}` syntax as a key.

This PR also fixes an issue with the array updating code that meant that
updating empty json values `""` or an empty `keymap.json` file in the
case of the Keymap Editor would fail instead of creating a new array.

Release Notes:

- Fixed an issue where keybindings would fail to save in the Keymap
Editor if the `keymap.json` file was completely empty
```

## Parents

- [1c27a6dbc2f754ed0b1ce67f25b15bade9297ce0](https://git.cafe/gitcafe/zed/commit/1c27a6dbc2f754ed0b1ce67f25b15bade9297ce0?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/99b71677c61588031bcb6b4c0543a2491962906f?format=markdown)
