Skip to content

multi-line var asignment indentation #53

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

Closed
wants to merge 3 commits into from
Closed

Conversation

utyf
Copy link
Contributor

@utyf utyf commented Jun 27, 2012

I made this changes some time ago for standard indenter and now merged them with this project.

It has some limitations:
- you need to use semicolons (it's quite common requirement)
- you need not to use multi-line variables (like objects, arrays or functions) in this variables' declaration (it's not common, but more readable)

Maybe, it contains some bugs, but I didn't meet them yet.

@pangloss
Copy link
Owner

pangloss commented Jul 3, 2012

Hey, I tried this out today and it seems to work fairly well. I found one problem when I tried it out on the source of d3.js:

var d3_array = d3_arraySlice; // conversion for NodeLists

This line ends with a semicolon but it also has a comment and it doesn't indent the next line correctly. Could you update your script to fix that?

Thanks, Darrick

@ThiefMaster
Copy link

I think something like this really needs to be added. I'm sure I'm not the only one for who this package's javascript indent is completely useless due to the lack of supporting multi-variable-var statements. They are incredibly common especially in node applications.

@ehynds
Copy link

ehynds commented Jan 18, 2013

+1

@billyvg
Copy link

billyvg commented Feb 7, 2013

This is super helpful except limitation 2 is kind of a dealbreaker.

@ghost
Copy link

ghost commented Mar 5, 2013

Usefull, thanks.

@goatslacker
Copy link
Collaborator

Thanks for the pull request @utyf and sorry it took so long to merge in. I fixed some edge cases and added support for comma-first style as well. Check the commit for more info.

aronhoff pushed a commit to aronhoff/vim-javascript that referenced this pull request Sep 1, 2015
Add complete list of JSDoc tags and synonyms
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 this pull request may close these issues.

6 participants