Hide an element inside the editor


I am thinking about hiding unnecessary suffixes which must be appended to all variables under a code style guideline. I have built a grammar which finds such suffixes and can style them now. What I would really like to do, though, is hide the suffixes and display a visual clue in their place instead. I have read about markers which seem to be suitable for tracking the position of the suffixes but I have not found a good example package that hides markers and expands them later, a little like code folds but for verbose information.

Any pointers would be highly appreciated!


If you can style them, you can hide them and use ::after or ::before to display a visual clue.


I tried that, but setting it to display: none; breaks clicking into the line afairc.


Try with opacity: 0


Or visibility: hidden