【问题标题】:How do you append text in CodeMirror如何在 CodeMirror 中附加文本
【发布时间】:2013-09-22 17:16:08
【问题描述】:

我知道你用过

editor.setValue(""); 

设置一个值,但如何在 CodeMirror 中追加?

IE:

 editor.appendText();?

【问题讨论】:

  • 类似editor.setValue(editor.getValue() + "appended text")?

标签: codemirror


【解决方案1】:

使用replaceRange。例如editor.replaceRange(myString, CodeMirror.Pos(editor.lastLine()))。重新设置整个编辑器是不必要的昂贵。


【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-24
    • 2014-03-06
    • 2012-02-09
    • 1970-01-01
    • 1970-01-01
    • 2019-10-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多