Skip to content

codemirror/settings-facet

Creates a CodeMirror Facet that carries a plugin’s settings into its editor extensions.

An extension reads the settings with state.facet(settingsFacet) instead of closing over a settings object, so a change reaches every editor as an ordinary reconfigure: SettingsFacetComponent swaps settingsFacet.of(settings) in a compartment, and every view plugin and state field sees the new value in the same update.

Function Description
createSettingsFacet Creates a facet whose value is the last settings value provided, or the default when none is.