Well, that’s what atomicRanges does—causes the whole range to be treated as a single thing for the purpose of cursor motion and backspacing. Some systems like this show the marks as text again when the cursor is on/near them.
Hello ! I will ask my question here instead of creating another discussion. I am interested in @devWithKD use case. I do not want to apply the decorator when the cursor on the line. Only applied when the cursor is outside. How to achieve that? I am not sure to understand how to control decorator visibility.
I changed the update method like this:
update(update: ViewUpdate) {
// Create new decorators
this.foldedStrikeTags = strikeTagMatcher.createDeco(update.view);
// Apply only outside of range
for (const range of update.state.selection.ranges) {
this.foldedStrikeTags = this.foldedStrikeTags.update({
filter(from, to, _value) {
return to < range.from || from > range.to;
},
});
}
}