This commit is contained in:
Liang Ding 2014-10-10 11:27:17 +08:00
parent 0bcd418dda
commit 8e888aa936
1 changed files with 4 additions and 4 deletions

View File

@ -161,6 +161,7 @@ var editors = {
$("#dialogGoLinePrompt").dialog("open"); $("#dialogGoLinePrompt").dialog("open");
}; };
// 用于覆盖 cm 默认绑定的某些快捷键功能.
CodeMirror.commands.doNothing = function (cm) { CodeMirror.commands.doNothing = function (cm) {
}; };
@ -343,9 +344,6 @@ var editors = {
editor.setSize('100%', $(".edit-panel").height() - $(".edit-panel .tabs").height()); editor.setSize('100%', $(".edit-panel").height() - $(".edit-panel .tabs").height());
editor.setValue(data.content); editor.setValue(data.content);
editor.setOption("mode", data.mode); editor.setOption("mode", data.mode);
editor.setCursor(cursor);
editor.setOption("gutters", ["CodeMirror-lint-markers", "CodeMirror-foldgutter"]); editor.setOption("gutters", ["CodeMirror-lint-markers", "CodeMirror-foldgutter"]);
if ("text/x-go" === data.mode || "application/json" === data.mode) { if ("text/x-go" === data.mode || "application/json" === data.mode) {
@ -356,6 +354,8 @@ var editors = {
editor.setOption("autoCloseTags", true); editor.setOption("autoCloseTags", true);
} }
editor.setCursor(cursor);
wide.curEditor = editor; wide.curEditor = editor;
editors.data.push({ editors.data.push({
"editor": editor, "editor": editor,