Open bordaigorl opened 12 years ago
It works really well! Good job!
As an improvement, it would be nice if it worked when selecting the whole table, not only the separators.
L.E: I fixed the issue by creating a new table cleaner package that can be found here https://github.com/mishu91/Sublime-Text-2-Table-Cleaner
Regards, Andrei
Would be nice to have multiline selection support. Have the following example:
return {
isString: function(value){ // <- selected line
return typeof value == 'string';
},
isBoolean: function(value){ // <- selected line
return typeof value == 'boolean'
}
}
If the lines are selected as indicated in the comments, I want to align them by ":", as below
return {
isString : function(value){ // <- selected line
....
isBoolean : function(value){ // <- selected line
....
}
But currently this is not possible. Instead I have to select all the lines and align them, with the result below
return {
isString : function(value){
return typeof value == 'string';
},
isBoolean : function(value){
return typeof value == 'boolean'
},
}
which is not what I need.
This happens because I have both = and : as alignment characters ("alignment_space_chars": ["=",":"]) Also, it would be nice to have an option to only align same character, and not both = and : under the same alignment.
Thanks.
Hi radubrehar,
using the patch I suggested in this thread, you can achieve the effect you described by simply selecting the two colons and pressing Ctrl+Alt+A.
In my opinion this is the most flexible, yet simple, solution that allows for very quick editing and supports any delimiter the user might need. The pattern is: select all the occurrences of the delimiters to be aligned (maybe multicolumn); this can be done by manually selecting or via Ctrl+D or regex matching. Then press Ctrl+Alt+A and the job is done.
Thanks bordaigorl!
Indeed it worked well! Yes, this is very flexible. It would still be useful to have an additional plugin or functionality over this, that performs this automatically, depending on some configs,
But anyway, works great!
In a situation like
one would like to be able to select all the
&
, pressctrl+alt+a
and obtainbut currently the plugin only aligns the first ones (with too many spaces):
My suggestion is to change the code handling multiple selections as follows:
which groups the selections by rows and processes the first sel of each row, then the seconds etc.
This is particularly useful when writing LaTeX tables for example.