Signal a beforeCursorEnter event on marked ranges

Closes #1368