sublime_alignment icon indicating copy to clipboard operation
sublime_alignment copied to clipboard

Bug/Idea : Align all valid characters and not just the first

Open ktaragorn opened this issue 12 years ago • 2 comments

An example speaks wonders.

If I have setting "alignment_chars": [",", "="]

What I have

PARAMS = {
    #NEEDS l18n
    "1" => {title: "TITLE1", active: 1},
    "2" => {title: "TITLE2", active: 1, back:1},
    "2b" => {title: "TITLE2.b", active: 1, back:1},
    "3" => {title: "TITLE3", active: 3, back:1},
    "4" => {title: "TITLE4", active: 4, back:3},
    "5" => {title: "TITLE5", active: 5, back:4},
 }

What I get

PARAMS = {
    #NEEDS l18n
    "1"  => {title: "TITLE1", active: 1},
    "2"  => {title: "TITLE2", active: 1, back:1},#bug?
    "2b" => {title: "TITLE2.b", active: 1, back:1},
    "3"  => {title: "TITLE3", active: 3, back:1},
    "4"  => {title: "TITLE4", active: 4, back:3},
    "5"  => {title: "TITLE5", active: 5, back:4},
  }

What I want to get

PARAMS = {
    #NEEDS l18n
    "1"  => {title: "TITLE1"  , active: 1},
    "2"  => {title: "TITLE2"  , active: 1, back:1},
    "2b" => {title: "TITLE2.b", active: 1, back:1},
    "3"  => {title: "TITLE3"  , active: 3, back:1},
    "4"  => {title: "TITLE4"  , active: 4, back:3},
    "5"  => {title: "TITLE5"  , active: 5, back:4},
  }

To get this, currently, I need to Align once, remove "=" and then align again.

ktaragorn avatar Aug 07 '13 03:08 ktaragorn

this simple plugin is intended for really simple 1-click alignment dunno why alignment_chars doesn't work as intended try AlignTab by randy3k - it allows to break the lines with regular expressions, e.g. =>|, for your case

steven-pribilinskiy avatar Sep 12 '13 01:09 steven-pribilinskiy

@pribilinskiy Cool, let me take a look. I was at one point contemplating fixing this myself, but I seem to have taken on too many projects lately :(

ktaragorn avatar Sep 12 '13 03:09 ktaragorn