I’m developing a Slack-like text editor with support for inline code
blocks – a piece of text between a pair or backticks. I’m using Match Decorator to detect all occupancies of enclosed text and apply Mark Decoration (not Decoration.replace) to it.
It works well, except I can’t click inside the marked piece of text to position the cursor. See the demo and try to click inside the CODE span – you can’t position the cursor inside of it. Though it’s possible to do if you move the cursor with arrow keys.
How to prevent CM from skipping the matched part of text when clicking?