This commit is contained in:
Liang Ding 2014-12-11 23:11:10 +08:00
parent 29ae107de4
commit 0a1e3eb9b8
3 changed files with 19 additions and 5 deletions

View File

@ -438,7 +438,7 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
}
lint := &Lint{
File: file,
File: filepath.Join(curDir,file),
LineNo: lineNo - 1,
Severity: lintSeverityError,
Msg: msg,

View File

@ -17,6 +17,13 @@
var editors = {
data: [],
tabs: {},
getEditorByPath: function (path) {
for (var i = 0, ii = editors.data.length; i < ii; i++) {
if (editors.data[i].editor.options.path === path) {
return editors.data[i].editor;
}
}
},
close: function () {
$(".edit-panel .tabs > div[data-index=" + $(".edit-panel .frame").data("index") + "]").find(".ico-close").click();
},

View File

@ -17,7 +17,7 @@
var wide = {
curNode: undefined,
curEditor: undefined,
curProcessId: undefined, // 当前正在运行的进程 idpid
curProcessId: undefined, // curent running process id (pid)
_initDialog: function () {
$(".dialog-prompt > input").keyup(function (event) {
var $okBtn = $(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");
@ -379,20 +379,27 @@ var wide = {
bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);
if (data.lints) { // has build error
var files = {};
for (var i = 0; i < data.lints.length; i++) {
var lint = data.lints[i];
goLintFound.push({from: CodeMirror.Pos(lint.lineNo, 0),
to: CodeMirror.Pos(lint.lineNo, 0),
message: lint.msg, severity: lint.severity});
files[lint.file] = lint.file;
}
$(".toolbars .ico-stop").removeClass("ico-stop")
.addClass("ico-buildrun").attr("title", config.label.build_n_run);
}
// trigger gutter lint
CodeMirror.signal(wide.curEditor, "change", wide.curEditor);
// trigger gutter lint
for (var path in files) {
var editor = editors.getEditorByPath(path);
CodeMirror.signal(editor, "change", editor);
}
}
break;
}