I am using mark decorations that set different font-size on the same line.
Now the way Codemirror renders the cursor is based on the direction of navigation.
To simplify it, let’s say I have only two ranges <range 1><range 2>.
If I navigate from left to right (or by default), the cursor between the ranges will have the height of range 1.
If I navigate from right to left, the cursor between the ranges will have the height of range 2.
That’s reasonable. But I would like the cursor to instead take into account the inclusiveness of the decorations.
So say range 2 has a inclusive: false
mark Decoration. If I navigate from right to left, I want the cursor to have the height of range 1, not of range 2, when it’s between the ranges.
Now I am already using a custom implementation of cursors, so I could customize measureCursor
function to take into account the decorations present at the pos - but I how do I get the decorations at given position?
I am looking for something like view.directlyProvidedDecorationsAtPos(pos: number)
. Does this exist somewhere that I’m missing it? Or how could I implement it? Or is there a simpler solution to my problem?
Thanks as always!