Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beautify-json hardcodes indent level #19

Closed
petere opened this issue Mar 6, 2014 · 7 comments · Fixed by #29
Closed

beautify-json hardcodes indent level #19

petere opened this issue Mar 6, 2014 · 7 comments · Fixed by #29

Comments

@petere
Copy link
Contributor

petere commented Mar 6, 2014

beautify-json hardcodes indent=4, but it should use js-indent-level.

@joshwnj
Copy link
Collaborator

joshwnj commented Mar 6, 2014

+1

@joshwnj
Copy link
Collaborator

joshwnj commented Mar 17, 2014

Closing this now that we're using json-reformat as in #20

@joshwnj joshwnj closed this as completed Mar 17, 2014
@petere
Copy link
Contributor Author

petere commented Jun 27, 2014

This still doesn't work correctly, as json-reformat also hardcodes 4.

@joshwnj
Copy link
Collaborator

joshwnj commented Jul 15, 2014

Hm you're right - let's see if we can fix that

@gongo
Copy link

gongo commented Oct 9, 2014

Hi. @petere @joshwnj

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! 🍕

@joshwnj
Copy link
Collaborator

joshwnj commented Oct 9, 2014

This is great @gongo, thanks!

@joshwnj joshwnj closed this as completed Oct 9, 2014
@petere
Copy link
Contributor Author

petere commented Mar 9, 2015

I think this still doesn't work, because json-reformat:indent-width is not set to js-indent-level anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants