This commit is contained in:
Van 2014-10-15 16:26:39 +08:00
parent 061a4fd440
commit 87d2f7a134
1 changed files with 8 additions and 4 deletions

View File

@ -312,8 +312,7 @@ var wide = {
} }
if ('run' === data.cmd) { // 正在运行 if ('run' === data.cmd) { // 正在运行
$('.bottom-window-group .output').text($('.bottom-window-group .output').text() + data.output); wide.fillOutput($('.bottom-window-group .output').text() + data.output);
wide.curProcessId = data.pid; wide.curProcessId = data.pid;
} else if ('run-done' === data.cmd) { // 运行结束 } else if ('run-done' === data.cmd) { // 运行结束
wide.curProcessId = undefined; wide.curProcessId = undefined;
@ -321,7 +320,7 @@ var wide = {
$(".toolbars .ico-stop").removeClass("ico-stop") $(".toolbars .ico-stop").removeClass("ico-stop")
.addClass("ico-buildrun").attr("title", config.label.build_n_run); .addClass("ico-buildrun").attr("title", config.label.build_n_run);
} else if ('build' === data.cmd || 'go install' === data.cmd) { } else if ('build' === data.cmd || 'go install' === data.cmd) {
$('.bottom-window-group .output').text(data.output); wide.fillOutput(data.output);
if (0 !== data.output.length) { // 说明编译有错误输出 if (0 !== data.output.length) { // 说明编译有错误输出
for (var i = 0; i < data.lints.length; i++) { for (var i = 0; i < data.lints.length; i++) {
@ -339,7 +338,7 @@ var wide = {
// 触发一次 gutter lint // 触发一次 gutter lint
CodeMirror.signal(wide.curEditor, "change", wide.curEditor); CodeMirror.signal(wide.curEditor, "change", wide.curEditor);
} else if ('go get' === data.cmd || 'go install' === data.cmd) { } else if ('go get' === data.cmd || 'go install' === data.cmd) {
$('.bottom-window-group .output').text($('.bottom-window-group .output').text() + data.output); wide.fillOutput($('.bottom-window-group .output').text() + data.output);
} }
}; };
outputWS.onclose = function (e) { outputWS.onclose = function (e) {
@ -453,6 +452,11 @@ var wide = {
} }
}); });
}, },
fillOutput: function (data) {
var $output = $('.bottom-window-group .output');
$output.text(data);
$output.scrollTop($output[0].scrollHeight);
},
// 构建 & 运行. // 构建 & 运行.
run: function () { run: function () {
if ($(".menu li.run").hasClass("disabled")) { if ($(".menu li.run").hasClass("disabled")) {