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

Use json-reformat:indent-level for indenting on newline? #26

Open
ProjectMoon opened this issue Jan 21, 2015 · 4 comments
Open

Use json-reformat:indent-level for indenting on newline? #26

ProjectMoon opened this issue Jan 21, 2015 · 4 comments

Comments

@ProjectMoon
Copy link

Apparently the mode uses js-indent-level for indenting when you press newline, but json-reformat:indent-level when calling that format function. Then of course there's also js2-basic-offset. Lots of variables, a bit confusing. Maybe better to unify?

@joshwnj
Copy link
Collaborator

joshwnj commented Jan 21, 2015

Good idea, thanks :)

Where do you see js2-basic-offset coming into it?

@ProjectMoon
Copy link
Author

I don't see it really coming in anywhere, it's just another variable that might add to the confusion. Maybe another option would be a configuration option to tell which indent to inherit from. I use js2-mode for JavaScript development, and was using js-mode for JSON until I found this (simply because it's the default).

@ProjectMoon
Copy link
Author

Alternatively, maybe just better documentation would fix this. I didn't see anything about js-indent-level controlling the indentation of json-mode when hitting newline until I discovered it myself. Reading the documentation led me to believe that it would work if I set the json-reformat:indent-level variable.

@aiguofer
Copy link

Thanks @ProjectMoon, I was looking all over for this. Finally I have consistent behavior :)

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

No branches or pull requests

3 participants