beautify-json hardcodes indent level
Closed this issue · 7 comments
petere commented
beautify-json
hardcodes indent=4
, but it should use js-indent-level
.
joshwnj commented
+1
petere commented
This still doesn't work correctly, as json-reformat
also hardcodes 4.
joshwnj commented
Hm you're right - let's see if we can fix that
gongo commented
json-reformat:indent-width
has been implemented in json-reformat
Example
{"name": "John Smith", "age": 33, "info": {"eat": "pizza", "sport": "soccer"}}
(setq json-reformat:indent-width 4) ;; default
;; {
;; "info": {
;; "sport": "soccer",
;; "eat": "pizza"
;; },
;; "age": 33,
;; "name": "John Smith"
;; }
(setq json-reformat:indent-width 12)
;; {
;; "info": {
;; "sport": "soccer",
;; "eat": "pizza"
;; },
;; "age": 33,
;; "name": "John Smith"
;; }
Try it! 🍕
petere commented
I think this still doesn't work, because json-reformat:indent-width
is not set to js-indent-level
anywhere.