2013-09-22 21 views
6

So che si utilizzaCome aggiungere testo in CodeMirror

editor.setValue(""); 

per impostare un valore ma come si fa aggiungo in CodeMirror?

IE:

editor.appendText();? 
+0

Qualcosa come 'editor.setValue (editor.getValue() +" testo aggiunto ")'? –

risposta

8

Usa replaceRange. Ad esempio editor.replaceRange(myString, CodeMirror.Pos(editor.lastLine()). Reimpostare l'intero editor è inutilmente costoso.

Problemi correlati