Closed Jaeiya closed 9 years ago
Hi @Aedaeum,
Thanks for the feature request. This annoys me like no other, but I have been manually aligning it since I moved from coffee => javascript.
I will get on this as soon as I figure out whether or not I want to refactor this package to be more configurable.
Thanks for the quick response. I will definitely be looking forward to this.
Now that I am thinking about it, it is getting pretty complex.
I might start with something then we can tweak it. I wonder if my friend has tackled this problem yet.
1: var func = function () {};
2: # comment here
3: var one = 1,
4: two = 2;
5: var secret = 'key';
6: var three = 3,
7: four = 4;
Currently, the implementation for comments are ignored, but I forgot how exactly I implemented them. What if you try to align the comment? What if you try to align the first two var
statements (It should skip over the comment, but not break because of it)?
If you align line 5, the implementation as it stands will grab line 6, but I am guessing line 7 would want to be captured. Does this also mean boundaries should be stepped by reaching to variables above it (Lines 1 - 4)?
My thought is that we start with finding the var
and sticking to that block. My code style is that if you are separating out var
statements (As in lines 3 and 6), there probably should be a new line between them.
I agree that sticking to each var block separated by a new line is preferable.
@Aedaeum, lots of breaking changes with all the code modifications. Though the basic feature support for var alignment is in there. It is a bit finicky because the implementation was even more complicated than I stated before.
Please let me know if you run into any other bugs caused by the refactor.
Fixed by 6ed73e85ac27f46ffe4d539102f5d6c4ee44ae4a
This is a great plugin. I have only one suggestion
from
to