I am using codeMirror plugin for syntax highlighting.My code is generating on button click dynamically.So I need to replace the existing code each button click.i have tried refresh() function but it isn't working.is there any other way to replace whole code on button click??
Below is the code:-
var editor = CodeMirror.fromTextArea(document.getElementById("ebot_code_full_width"), { lineNumbers: true, mode: "text/x-c++src", matchBrackets: true, });
editor.setValue(ebotCode);
var tocm = document.getElementById("ebot_code_full_width");
var cminst = CodeMirror.fromTextArea(tocm);
cminst.refresh();