Editor marker CSS


#1

Hey there, was just wondering if there’s any way to assign a CSS class to a text marker? So given an EditorView one could identify a piece of text and color it differently.

Similar to what is being done in the Atom Color Highlight package at https://github.com/abe33/atom-color-highlight . But that appears to make a view that sits behind the text, and therefore cant modify the text color itself.

Thanks!


#2

AFAIK this is not possible unless you use a specific grammar. Markers aren’t visual entities to begin with, that’s why I create a view for each marker (as done by the find and replace package and probably many other one).

Maybe, if someone can explain how to extend the current grammar with custom rules (as I asked there without much success), we’ll be able to properly styles “markers” directly in the editor text. But until then the back/front view is the most viable option.


#3

Thanks abe, true that markers arn’t visual entities. Ideally I wanted something that moves itself around as text is entered like with markers.

Would be cool to see a feature like this added.