Thanks, this works well!
One question that I have: In the theme I use, the legacy editor deactivates the background-color of the active line as soon as some text is selected.
Now in live preview this does not seem to be the case so that I need to use two different background-colors for selection and active line. I really liked the old behaviour - is it possible to regain it also in live preview?