Cannot Switch modes correctly

47 views
Skip to first unread message

Bhushan Nagaonkar

unread,
Mar 22, 2012, 11:17:35 AM3/22/12
to ace-in...@googlegroups.com
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


Reply all
Reply to author
Forward
0 new messages