 //Codemirror editor
       CodeMirror.commands.hideText = function(cm) {
       var selection =  editor.getSelection();
	   if (selection.length > 0) {
		   editor.replaceSelection ("");
		   hiddenText.push(selection);
		   
	   }
      }
	  CodeMirror.commands.showText = function(cm) {
		  var editorValue=editor.getValue()+ "\n";
      for (var i=0; i<hiddenText.length; i++){
	
		  editorValue += hiddenText[i]
		}
		hiddenText = [];
		editor.setValue (editorValue)
	   }
      
 var editor = CodeMirror.fromTextArea(document.getElementById("code"), {matchBrackets: true,
	  lineNumbers: false, 
	  styleActiveLine: true,
	  lineWrapping: true,
	   extraKeys : {  "Insert" :function (cm) {
		  play();
		   
		   },
		  "Ctrl-H":  "hideText",
		  "Ctrl-Space": "showText"
	  }
	  
	  });
var hiddenText = [];

	  
function changeFontSize (size) {
	$('.CodeMirror').css("font-size", size +"px");
	editor.refresh();
	
	}
	
changeFontSize (16);