2

This question already has an answer here:

Is there an non-intrusive way to do this?

demo

I've made a fork of rainbow-mode that uses overlay instead of text properties, which solves this :)

https://github.com/amosbird/rainbow-mode

marked as duplicate by Drew, Stefan, Community Oct 27 '17 at 2:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Looking at both packages, hl-line mode uses overlays, and rainbow-mode uses font locking. Overlays always take priority over text properties, so I don't think there is simple solution to this. – Tyler Oct 26 '17 at 16:48
  • I use a custom version of highlight-parentheses (which uses overlays) and it is possible to set its priority overlays to a value higher than hl-line mode. If that interests you, give it a try. If you get stuck, consider opening a new question asking how to do that. – lawlist Oct 26 '17 at 19:02
  • OK. So the only solution to this seems to be an overlay version of rainbow mode. – Amos Oct 27 '17 at 1:53