CodeMirror VIM extension in v5 respected the cursor blinking rate. This is not the case with the replit fork (Could the cursor use blinking rate from `drawSelection`? · Issue #140 · replit/codemirror-vim · GitHub ). A simple way to get the current configuration would be via facet method passing selectionConfig
, but that is not exported:
const selectionConfig = Facet.define<SelectionConfig, Required<SelectionConfig>>({
combine(configs) {
return combineConfig(configs, {
cursorBlinkRate: 1200,
drawRangeCursor: true
}, {
cursorBlinkRate: (a, b) => Math.min(a, b),
drawRangeCursor: (a, b) => a || b
})
}
})
Could selectionConfig
be exported, or is there a better way to retrieve the configuration in this case?
1 Like
Circling back on this, would a pull request to expose selectionConfig
be welcome?
marijn
September 18, 2023, 6:43am
3
This is going to be messy. We don’t know the (native) blink rate when drawSelection
isn’t active, and the vim extension probably can’t assume it is, so it’d need to somehow handle that case too. no?
codemirror-vim requires drawSelection
to render selection in visual mode so it can assume that drawSelection
is active I think.
marijn
September 20, 2023, 8:29am
5
Does this patch look like it would work for you?
committed 08:29AM - 20 Sep 23 UTC
FEATURE: The new `getDrawSelectionConfig` function returns the `drawSelection`
c… onfiguration for a given state.
See https://discuss.codemirror.net/t/how-to-get-cursor-blinking-rate-in-another-extension/7077
1 Like
Yes, this looks exactly as what is needed, thank you!