Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could the cursor use blinking rate from drawSelection? #140

Closed
krassowski opened this issue Sep 7, 2023 · 3 comments · Fixed by #141
Closed

Could the cursor use blinking rate from drawSelection? #140

krassowski opened this issue Sep 7, 2023 · 3 comments · Fixed by #141
Assignees

Comments

@krassowski
Copy link

Currently the cursor blinking rate is hard-coded:

setBlinkRate() {
this.cursorLayer.style.animationDuration = 1200 + "ms"
}

Would it be a good idea to try matching the current setting as configured in drawSelection extension?

@nightwing
Copy link
Collaborator

This sounds like a good idea, but do you know any non-hacky way to get that value from codemirror? The only solution i know so far is to do drawSelection()[0].facet ignoring the typing errors, which is not very good.

@krassowski
Copy link
Author

I think it should be available from cm.view.state.facet(selectionConfig) but selectionConfig is not currently exported. I asked on the forum: https://discuss.codemirror.net/t/how-to-get-cursor-blinking-rate-in-another-extension/7077

@krassowski
Copy link
Author

It should be possible to use getDrawSelectionConfig function in future versions, see https://discuss.codemirror.net/t/how-to-get-cursor-blinking-rate-in-another-extension/7077/5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants