Pulsar-Edit-Highlights / line

@Pulsar-Edit package for highlighting the currently selected line.
https://web.pulsar-edit.dev/packages/highlight-line
MIT License
52 stars 16 forks source link

Use decorations #23

Closed benogle closed 10 years ago

benogle commented 10 years ago

Most of this functionality now exists in core. Each line the cursor is on gets a class of cursor-line (see the atom light syntax theme for an example.

As for orange borders around your selection, you should use decorations.

Removing code for the cursor line highlighting and using decorations for the selection outlines should substantially reduce code.

benogle commented 10 years ago

Note that we plan to remove the underlayer.

richrace commented 10 years ago

I've had a go at using the decoration API for this but it doesn't really work unless a fullHeight and fullWidth option is available.

It would also be nice to alter the style of a region dynamically.

benogle commented 10 years ago

I'm not understanding why you need the fullHeight or fullWidth option. The line type decorations are inherently full width. Also, the cursor line highlighting is already provided by core as a .cursor-line class on the cursor's line.

benogle commented 10 years ago

An additional fullHeight option would only be useful if you wanted to highlight a column.

richrace commented 10 years ago

Ah. I was using the highlight type. I noticed that I can't pass multiple classes through but you can using the highlight type.

benogle commented 10 years ago

I also agree on the style property. We should allow for setting arbitrary styles on the decorations. Packages that do things like highlight hex colors in css files would definitely benefit.