Aligning Comments in a column


#1

I’m not sure if I am just missing how to do this or it is not a feature yet.

Is there a way to align my single line comments on the right side? Sublime Text did this by default and I really liked it that way.

Thanks!


#2

Really? I’d be very surprised to see anything right aligned by default. Maybe I don’t understand. Maybe a screen cap?


#3

Sure thing. Atom is on the left. Sublime Text is on the right. Same file.


#4

It’s not right aligned…they are just lined up on the right. :smiley:


#5

Does something like this work? (put it in your styles.less)

atom-text-editor::shadow .line .comment:first-child:last-child {
  float: right;
  // or
  margin-left: 400px;
}

Can’t test right now, I’m on my phone


#6

Ok, this seems to work for me:

atom-text-editor::shadow .line .comment.line {
  margin-left: 400px;
}

but it has the issue that the cursor position is way (way) off…