This commit is contained in:
Van 2015-03-21 20:22:53 +08:00
parent bd1a2778c3
commit 4ed531a6be
2 changed files with 18 additions and 10 deletions

View File

@ -192,10 +192,18 @@ var editors = {
'find', 'find-next', 'find-previous', 'replace', 'replace-all', 'find', 'find-next', 'find-previous', 'replace', 'replace-all',
'format', 'autocomplete', 'jump-to-decl', 'expr-info', 'find-usages', 'toggle-comment', 'format', 'autocomplete', 'jump-to-decl', 'expr-info', 'find-usages', 'toggle-comment',
'edit']); 'edit']);
// remove selected tree node
tree.fileTree.cancelSelectedNode();
wide.curNode = undefined;
wide.curEditor = undefined;
wide.refreshOutline();
$(".footer .cursor").text('');
return false;
} }
if (!nextId) { if (!nextId) {
// 不存在打开的编辑器 // 编辑器区域不存在打开的 Tab
// remove selected tree node // remove selected tree node
tree.fileTree.cancelSelectedNode(); tree.fileTree.cancelSelectedNode();
wide.curNode = undefined; wide.curNode = undefined;
@ -244,7 +252,7 @@ var editors = {
wide.curEditor = undefined; wide.curEditor = undefined;
wide.refreshOutline(); wide.refreshOutline();
$(".footer .cursor").text(''); $(".footer .cursor").text('');
var dateFormat = function (time, fmt) { var dateFormat = function (time, fmt) {
var date = new Date(time); var date = new Date(time);
var dateObj = { var dateObj = {
@ -411,7 +419,7 @@ var editors = {
if (mode && "go" !== mode.name) { if (mode && "go" !== mode.name) {
return CodeMirror.Pass; return CodeMirror.Pass;
} }
var token = cm.getTokenAt(cm.getCursor()); var token = cm.getTokenAt(cm.getCursor());
if ("comment" === token.type || "string" === token.type) { if ("comment" === token.type || "string" === token.type) {
@ -804,9 +812,9 @@ var editors = {
"Shift-Alt-J": "selectIdentifier" "Shift-Alt-J": "selectIdentifier"
} }
}); });
if ("text/html" === data.mode) { if ("text/html" === data.mode) {
emmetCodeMirror(editor); emmetCodeMirror(editor);
} }
editor.on('cursorActivity', function (cm) { editor.on('cursorActivity', function (cm) {

View File

@ -280,6 +280,11 @@ var menu = {
run: function () { run: function () {
menu.saveAllFiles(); menu.saveAllFiles();
if ($("#buildRun").hasClass("ico-stop")) {
wide.stop();
return false;
}
var currentPath = editors.getCurrentPath(); var currentPath = editors.getCurrentPath();
if (!currentPath) { if (!currentPath) {
return false; return false;
@ -289,11 +294,6 @@ var menu = {
return false; return false;
} }
if ($("#buildRun").hasClass("ico-stop")) {
wide.stop();
return false;
}
var request = newWideRequest(); var request = newWideRequest();
request.file = currentPath; request.file = currentPath;
request.code = wide.curEditor.getValue(); request.code = wide.curEditor.getValue();