jarod2d / sublime_valign

Vertical alignment plugin for Sublime Text 2 and 3
91 stars 7 forks source link

Align wrapped argument #12

Closed rchl closed 11 years ago

rchl commented 11 years ago

In C++ (or JS) when writing arguments for a function and wanting to align them with the opening parenthesis, for example:

void MyFunction(argument1,

and pressing enter at the end, Sublime does not align caret with the opening parenthesis. We need to align argument2 manually and then, if we would like to add argument3 and more, these will be aligned properly already. So to make this first step easier, I would propose that the plugin could help with that manual alignment on press of the shortcut.

I don't know if you consider this to be in scope of this plugins responsibilities. If not then I guess you can just close it. Otherwise I might try to implement this. I haven't look at the plugin code yet so I'm not sure how will it fit, though.

jarod2d commented 11 years ago

Hmm, I think this is a bit outside of the scope of this plugin. VAlign is focused more on situations where you have left-hand and right-hand values separated by some set of characters. I prefer maintaining a narrow focus like this to prevent these kinds of tools from becoming bloated with too many features.

I'd definitely encourage you to make your own plugin with this functionality, though, or maybe just fork VAlign. It sounds like it would be pretty useful. I'm going to go ahead and close this for now, though. But thanks for the suggestion!

rchl commented 11 years ago

No problem. Since writing this report I've realized that Sublime has indent_to_bracket option that does more or less what I want (it's a little bit too eager). And also wrote a plugin that does exactly what I want.