Skip to content

multi-line var asignment indentation#53

Closed
utyf wants to merge 3 commits into
pangloss:masterfrom
utyf:master
Closed

multi-line var asignment indentation#53
utyf wants to merge 3 commits into
pangloss:masterfrom
utyf:master

Conversation

@utyf

@utyf utyf commented Jun 27, 2012

Copy link
Copy Markdown
Contributor

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

pangloss commented Jul 3, 2012

Copy link
Copy Markdown
Owner

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
Copy Markdown

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

ehynds commented Jan 18, 2013

Copy link
Copy Markdown

+1

@billyvg

billyvg commented Feb 7, 2013

Copy link
Copy Markdown

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

@ghost

ghost commented Mar 5, 2013

Copy link
Copy Markdown

Usefull, thanks.

@goatslacker

Copy link
Copy Markdown
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