Open am-den opened 1 year ago
getCursor
reproduces the old CodeMirror5 API and its use is not recommended.
To get the cursor just call the cursor
variable. In this case, you should be able to get it with mirror.value.cursor
. Since this is a WritableComputedRef
, it can be treated like a variable.
I did try that too, yet the cursor position is not updated.
const getCursor = (e) => {
console.debug(mirror.value.cursor)
}
The cause was that the change of EditorState
in EditorView
could not be detected.
Currently investigating countermeasures.
Hi @logue, if there are any updates for that issue? I see that you added fix, but for me behavior is still the same as @mimnot described. We are using v1.1.19
I don't have much time for development resources, but I made it work only to get the cursor position.
Hi,
I'm trying to get the cursor position (using either the
getCursor
method or thecursor
property) but it always returns the same value.I slightly modified one of the provided example to demonstrate this behavior. Clicking on the
getCursor
button for the first time will output the correct cursor position. But after that, it will always output the same position, whatever the cursor position is.Here the expected result