From 10ddfa6251cf29c55f301fe27075467cdde6e9e4 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 6 Sep 2014 23:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8A=98=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/editor.js | 7 ++++++- view/index.html | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/static/js/editor.js b/static/js/editor.js index b729e60..3bc0810 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -154,6 +154,7 @@ var editors = { styleActiveLine: true, theme: 'lesser-dark', indentUnit: 4, + foldGutter: true, extraKeys: { "Ctrl-\\": "autocompleteAnyWord", ".": "autocompleteAfterDot", @@ -174,11 +175,15 @@ var editors = { editor.setValue(data.content); editor.setOption("mode", data.mode); - editor.setOption("gutters", ["CodeMirror-lint-markers"]); + editor.setOption("gutters", ["CodeMirror-lint-markers", "CodeMirror-foldgutter"]); if ("application/json" === data.mode) { editor.setOption("lint", true); } + + if ("application/xml" === data.mode || "text/html" === data.mode) { + editor.setOption("autoCloseTags", true); + } wide.curEditor = editor; editors.data.push({ diff --git a/view/index.html b/view/index.html index 5181dda..0d249c0 100644 --- a/view/index.html +++ b/view/index.html @@ -7,6 +7,7 @@ + @@ -102,8 +103,15 @@ + + + + + + +