wbond / sublime_alignment

Easy alignment of multiple selections and multi-line selections
http://wbond.net/sublime_packages/alignment
522 stars 110 forks source link

Plugin doesn't work when I select the text. #86

Closed Kristinita closed 8 years ago

Kristinita commented 8 years ago

Summary

Plugin doesn't work when I select the text and run alignment command.

Expected behavior

Alignment when I select text

Actual behavior

Not alignment when I select text

Steps to reproduce

I checked on plain Sublime Text Portable without plugins.

My JavaScript code:

Tween.prototype = {
    constructor: Tween,
    init: function(elem, options, prop, end, easing, unit) {
    this.elem = elem;                                                                                
    this.prop = prop;                                                                                
    this.easing = easing || jQuery.easing._default;                    
    this.options = options;                                                                    
    this.start = this.now = this.cur();                                            
    this.end = end;                                                                                    
    this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
    },                                                                                                              
    cur: function() {                                                                                
    var hooks = Tween.propHooks[this.prop];

I allocate a text site, I press Ctrl+Alt+A, but nothing occurs:

Not Alignment

The console shows that at me everything is all right.

key evt: control+alt+a
command: alignment

If I allocate CSS-code, the plugin too doesn't work.

But if I clamp the Ctrl key and insert multiple cursors, the plugin works.

Alignment

Environment

wbond commented 8 years ago

You see to be doing a multi-cursor selection in the first example. Just do a single selection of all the lines you want to align.

Kristinita commented 8 years ago

@wbond, I squeezed the middle mouse button, it could not be done. Thank you very much!