From 84b0598678c2c11342e9db0338630834b9870ea7 Mon Sep 17 00:00:00 2001 From: Jason San Jose Date: Thu, 31 Jan 2013 15:25:17 -0800 Subject: [PATCH 1/2] Configure autoCloseTag add-on using default settings --- src/editor/Editor.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 134cd6dc434..d5eb466d269 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -326,9 +326,7 @@ define(function (require, exports, module) { "Esc": function (instance) { self.removeAllInlineWidgets(); }, - "Cmd-Left": "goLineStartSmart", - "'>'": function (cm) { cm.closeTag(cm, '>'); }, - "'/'": function (cm) { cm.closeTag(cm, '/'); } + "Cmd-Left": "goLineStartSmart" }; // We'd like null/"" to mean plain text mode. CodeMirror defaults to plaintext for any @@ -348,7 +346,8 @@ define(function (require, exports, module) { lineNumbers: true, matchBrackets: true, dragDrop: false, // work around issue #1123 - extraKeys: codeMirrorKeyMap + extraKeys: codeMirrorKeyMap, + autoCloseTags: true }); // Can't get CodeMirror's focused state without searching for From 5c32c30860063a151f7eaa4750c72513a9244aa4 Mon Sep 17 00:00:00 2001 From: Jason San Jose Date: Thu, 31 Jan 2013 15:36:47 -0800 Subject: [PATCH 2/2] Closes #2547. Per NJ's suggestion, disabling new lines when tags are auto closed. --- src/editor/Editor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/editor/Editor.js b/src/editor/Editor.js index d5eb466d269..519cbfd2529 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -347,7 +347,11 @@ define(function (require, exports, module) { matchBrackets: true, dragDrop: false, // work around issue #1123 extraKeys: codeMirrorKeyMap, - autoCloseTags: true + autoCloseTags: { + whenOpening: true, + whenClosing: true, + indentTags: [] + } }); // Can't get CodeMirror's focused state without searching for