Multi-cursor line styling?


#1

I’m loving being able to tweak the appearance of my editor exactly how I want it. It’s truly unprecedented.

One of the few tweaks I’m not able to make at present is highlighting all lines with active cursors. Right now, only the last placed cursor styles the line it was placed on (with a .cursor-line class).

The way I’d like it to behave is to dimly highlight all lines with active cursors, while keeping the primary highlighting of the last selected line. This would require multiple .cursor-line classes on each line with a cursor (seems intuitive), and some extra acknowledgment of the primary or current cursor line (.cursor-line.current, .cursor-line.primary, .cursor-line.current-line or something).

By adding (.cursor-line) to all cursor lines, each would be highlighted out of the box, so this would be fairly backwards compatible with all themes and custom styles: those who don’t use multiple cursors wouldn’t notice, and those who do would benefit. It would be trivial to tweak it further to add extra emphasis to the primary cursor line, or tone down the others, the way I want it.

Does anyone else like the idea of this feature? I know I love multi-cursor editing and use it all the time, and Atom’s capabilities are a few tweaks away from surpassing Sublime’s. Being able to clearly see both all cursor lines and exactly which one was last placed would kill any debate for me. Let’s never lose a cursor in a sea of text again!


#2

I like this idea. I actually think it is just a fluke that every line with a cursor doesn’t have the .cursor-line class.


[Suggestion] Smarter new user restrictions
#3

This would be excellent! And exciting that it’s (potentially) just a bugfix away.

Any speculation as to what (if any) class would be given to the most recently placed cursor line? Honestly, it’s hard to imagine a context in multi-line editing where it’d be essential. The only boon I see in it is that wherever I place my cursor last is the line I’m going to watch while typing in the multi-edit, and slightly more prominent styling might train my eye better on that line given the potentially numerous line highlights dancing under the stream of multi-edit awesomeness.


#4

Adding a different class to the most recently placed cursor may require more work. I’m not sure if we track that or not, but I’ll look into it when I do the bug fix.


Multiple cursor issues
#5

Just curious, does the lastly placed selection/cursor provide any different functionality than the others? Otherwise they should be treated equally.

I can only think of being able to soft-undo the last selection but I don’t know if that’s possible. If it’s not or if there is a plugin for that, I feel like highlighting the lastly created selection differently should go to that plugin too.


#6

I have made a package that supports doing just this. However, instead of looking at the cursor-line, I look at the actual cursor get the position, then find the line and add the background. Which is obviously not ideal.

The code needs some improvements but it gets the job done.