Prevent selection within an atomicRange

How to prevent selection by mouse or SHIFT-ARROW of characters within atomicRange?

That should be how they behave by default.

Let me clarify. Suppose string is “BeforeAtomicAfter”. I can make a selection from within “Before” to within “After” and “Atomic” will be part of the selection. The individual characters in “Atomic” are not selectible, but as a whole it gets included in the selection.

And with mouse selection you can select partial within “Atomic.”

You mean you are not using EditorView.atomicRanges yet, and are asking how to do something like this?

I am using atomic ranges. Using the above example, the cursor jumps across “Atomic” if you are moving using arrow keys, so that part is working. I want to prevent selecting “Atomic”. I hope that is clear, and sorry for any miscommunication.

You want to prevent selections across the range, rather than within it? That’s not something the library provides, but you may be able to do it with a transaction filter.

OK. Thank you so much for your time.