简体   繁体   English

CodeMirror:是否可以通过\\注册模式作为委托函数?

[英]CodeMirror: Is it possible to pass \ register a mode as a delegate function?


I need to change values of tokens dynamically, using custom mode that i wrote. 我需要使用我编写的自定义模式动态更改令牌的值。
is it possible to change modes by passing delegate function of the mode, or maybe there is a better way. 是否可以通过传递模式的委托函数来更改模式,或者有更好的方法。
I am implementing codemirror using angular 2. 我正在使用angular 2实现codemirror。
thank you. 谢谢。

Yes, you can wrap a mode to create another mode. 是的,您可以包装一个模式以创建另一个模式。 See for example the yaml-frontmatter mode in the distribution, or the mode/multiplex and mode/overlay addons. 例如,请参阅发行版中的yaml-frontmatter模式或mode / multiplex和mode / overlay插件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM