diff --git a/demo/demo.js b/demo/demo.js index b2bc257a..2655a4c1 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -139,7 +139,7 @@ exports.launch = function(env) { docs.svg = new EditSession(document.getElementById("svgtext").innerHTML.replace("<", "<")); docs.svg.setMode(new SvgMode()); docs.svg.setUndoManager(new UndoManager()); - + docs.textile = new EditSession(document.getElementById("textiletext").innerHTML); docs.textile.setMode(new TextileMode()); docs.textile.setUndoManager(new UndoManager()); @@ -301,6 +301,10 @@ exports.launch = function(env) { env.editor.renderer.setHScrollBarAlwaysVisible(checked); }); + bindCheckbox("soft_tab", function(checked) { + env.editor.getSession().setUseSoftTabs(checked); + }); + function bindCheckbox(id, callback) { var el = document.getElementById(id); var onCheck = function() { @@ -383,11 +387,11 @@ exports.launch = function(env) { }); window.env = env; - + /** * This demonstrates how you can define commands and bind shortcuts to them. */ - + // Command to focus the command line from the editor. canon.addCommand({ name: "focuscli", @@ -400,7 +404,7 @@ exports.launch = function(env) { env.cli.cliView.element.focus(); } }); - + // Command to focus the editor line from the command line. canon.addCommand({ name: "focuseditor", @@ -413,7 +417,7 @@ exports.launch = function(env) { env.editor.focus(); } }); - + // Fake-Save, works from the editor and the command line. canon.addCommand({ name: "save", @@ -426,7 +430,7 @@ exports.launch = function(env) { alert("Fake Save File"); } }); - + // Fake-Print with custom lookup-sender-match function. canon.addCommand({ name: "save", @@ -435,9 +439,9 @@ exports.launch = function(env) { mac: "Command-P", sender: function(env, sender, hashId, keyString) { if (sender == "editor") { - return true; + return true; } else { - alert("Sorry, can only print from the editor"); + alert("Sorry, can only print from the editor"); } } }, diff --git a/index.html b/index.html index 60703dd5..4cdac4cd 100644 --- a/index.html +++ b/index.html @@ -71,7 +71,7 @@