Code is as follows :
if(mode.toLowerCase() == "cpp")
{
//editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
var c_cppMode = require("ace/mode/c_cpp").Mode;
editor.getSession().setMode(new c_cppMode());
}
else
if(mode.toLowerCase() == "java")
{
//editor = ace.edit("editor");
editor.setTheme("ace/theme/clouds");
var JavaMode = require("ace/mode/java").Mode;
editor.getSession().setMode(new JavaMode());
}
When I switch mode to java theme "clouds" is set and then when I switch to CPP mode theme "monokai" is set but when I again try to switch to JAVA mode the "monokai" still remain instead of whoch "clouds" them should be set.
I cannot understand the problem here? Plzz help guys