atom-alignment
atom-alignment copied to clipboard
Aligning a single line containing brackets
Atom: 1.0.0 atom-alignment: 0.12.1
Trying to align a single line containing brackets ([...] or (...)) doesn't work as expected.
Trying to align multiple lines does work as expected.
Consider the following example:
Input:
var fs = require( 'fs' );
Expected:
var fs = require( 'fs' );
Actual:
var fs = require(
'fs' );
works fine here. Will release a new version soon, could you please try later on?
I get the above result when I try to align with the keyboard shortcut (ctrl-cmd-a), is the keyboard shortcut supported for single lines?
It always seems to run atom-alignment:alignMultiple when using the shortcut. Running atom-alignment:align from the command panel works as expected.
If running separate commands for single vs. multiple lines is the intended behaviour feel free to close, I was assuming it would work like the Sublime plugin which uses a single command/shortcut for single & multiple lines.
I'll test the new version when it's published.
Some more info:
For single line alignment I was still selecting the entire line as I would for a multiline alignment.
If you place the cursor anywhere on the line (except the very start, column 1) instead of selecting it and trigger an alignment it will still be handled by atom-alignment:alignMultiple but will align as expected.
Interestingly, if you place your cursor at the beginning of a line (column 1) and trigger an alignment it will output on new lines (same as above when selecting the line):
var fs = require(
'fs' );
Not sure if related but I'm getting almost similar unexpected result.
Language: PHP Atom Version: 1.17.2 atom-alignment version: 0.13.0 Command: Ctrl + Alt + a
Sample code:
$var = new ClassName::methodName();
Expected result:
$var = new ClassName::methodName();
Actual result:
$var = new
ClassName::methodName();