Commit 78ae531
committed
feat(json):
Problem: There is no way to ensure a stable key order when encoding a JSON string,
which can be useful for comparisons and producing cleaner diffs.
Solution: Introduce a `sort_keys` option for `vim.json.encode()`,which
is disabled by default. When enabled, object keys are sorted in
alphabetical order.
Adapts PR to upstream: openresty/lua-cjson#115.sort_keys option to vim.json.encode()
1 parent 1b3abfa commit 78ae531
File tree
5 files changed
+270
-58
lines changed- runtime
- doc
- lua/vim/_meta
- src/cjson
- test/functional/lua
5 files changed
+270
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3375 | 3375 | | |
3376 | 3376 | | |
3377 | 3377 | | |
| 3378 | + | |
| 3379 | + | |
3378 | 3380 | | |
3379 | 3381 | | |
3380 | 3382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
0 commit comments