How to add text to CodeMirror

I know what you are using

editor.setValue(""); 

to set a single value, but how to add to CodeMirror?

IE:

  editor.appendText();? 
+6
source share
1 answer

Use replaceRange . For example editor.replaceRange(myString, CodeMirror.Pos(editor.lastLine()) . editor.replaceRange(myString, CodeMirror.Pos(editor.lastLine()) entire editor is useless expensive.

+8
source

Source: https://habr.com/ru/post/954362/


All Articles