Open fniessen opened 8 years ago
Sounds doable. I'm thinking to do it in a slightly simpler way: give all of $1, $2, $3 yas-field-face
(this would probably use the :box
attribute by default), and the current field will additionally get yas-field-highlight-face
(as it does now).
@npostavs, how would you do it? with an overlay? Those would have to be cleaned up, remember. Anything else might clash with the syntax highlighting, be it font-lock or simple text properties.
Yasnippet has once worked like this (before 0.6 though, I think), but I found it was distracting and clashed with the natural syntax highlighting. This way was much simpler, and also imitated TextMate better.
Uh, I had thought fields already have overlays on them, but if not, this might indeed involve more complexity than I'd want to add for such a feature.
Yasnippet has once worked like this (before 0.6 though, I think), but I found it was distracting and clashed with the natural syntax highlighting. This way was much simpler, and also imitated TextMate better.
Eclipse uses :box
style "highlighting" of fields, I think it looks reasonable.
Thanks for improving this. I'll love it!
@fniessen, if it were up to me (but it isn't anymore) I wouldn't get my hopes up. Adding this feature needlessly bloats yasnippet's sensitive engine.
Would it be possible to add a face (
yas-other-fields-highlight-face
or such) and to highlight all non-selected fields?The idea would be that:
That would make the variable elements in the template stand out a lot more.
Thanks a lot!