I made it pretty far with CodeMirror 6 and almost got a complete Markdown editor field for Kirby CMS working (see GitHub - sylvainjule/kirby-markdown-field at next). It’s just such a big step from CM5, thank you so much!
But I’m currently struggling with scrollMargins, because the editor field is supposed to have a sticky toolbar and Kirby also has a bottom bar, which sometimes covers parts of the editor. When I stumbled across scrollMargin support in the reference (CodeMirror 6 Reference Manual), I was wondering how I would create a single extension, that would just keep care of setting this property?
@marijn I’ve just updated all of the CM packages to their latest versions and somehow the PluginField class is not exported any longer. But in the view’s changelog I cannot find anything. Was this an intentional change? If so, I’d like to ask you kindly for providing an updated example.
It looks like the changelog on the website is broken, I’ll look into that. For now, take a look at the changelog file on github, or the announcement post.
@marijn Thanks for the info. But to be honest, I’m afraid that still don’t understand the concept of Facets, though. What’s the simplest way of providing a scrollmargins value to the editor?
Sorry to bother you.
I get some confuse with this functionality in 0.20.0, and I tried it for several hours but I haven’t make it.
Could you please give me some hint or example?
Is this still the way to do scrollMargins? I can’t seem to get this code working.
Looking at the Reference Manual I don’t see anything about PluginField, so I don’t even know where to import that from.
I do see that scrollMargins is now a Facet under EditorView. I can get the following extension to execute but it doesn’t seem to actually work for increasing the scroll margin.