Fix #77
This commit is contained in:
parent
29ae107de4
commit
0a1e3eb9b8
|
@ -438,7 +438,7 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
lint := &Lint{
|
lint := &Lint{
|
||||||
File: file,
|
File: filepath.Join(curDir,file),
|
||||||
LineNo: lineNo - 1,
|
LineNo: lineNo - 1,
|
||||||
Severity: lintSeverityError,
|
Severity: lintSeverityError,
|
||||||
Msg: msg,
|
Msg: msg,
|
||||||
|
|
|
@ -17,6 +17,13 @@
|
||||||
var editors = {
|
var editors = {
|
||||||
data: [],
|
data: [],
|
||||||
tabs: {},
|
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 () {
|
close: function () {
|
||||||
$(".edit-panel .tabs > div[data-index=" + $(".edit-panel .frame").data("index") + "]").find(".ico-close").click();
|
$(".edit-panel .tabs > div[data-index=" + $(".edit-panel .frame").data("index") + "]").find(".ico-close").click();
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
var wide = {
|
var wide = {
|
||||||
curNode: undefined,
|
curNode: undefined,
|
||||||
curEditor: undefined,
|
curEditor: undefined,
|
||||||
curProcessId: undefined, // 当前正在运行的进程 id(pid)
|
curProcessId: undefined, // curent running process id (pid)
|
||||||
_initDialog: function () {
|
_initDialog: function () {
|
||||||
$(".dialog-prompt > input").keyup(function (event) {
|
$(".dialog-prompt > input").keyup(function (event) {
|
||||||
var $okBtn = $(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");
|
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);
|
bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);
|
||||||
|
|
||||||
if (data.lints) { // has build error
|
if (data.lints) { // has build error
|
||||||
|
var files = {};
|
||||||
|
|
||||||
for (var i = 0; i < data.lints.length; i++) {
|
for (var i = 0; i < data.lints.length; i++) {
|
||||||
var lint = data.lints[i];
|
var lint = data.lints[i];
|
||||||
|
|
||||||
goLintFound.push({from: CodeMirror.Pos(lint.lineNo, 0),
|
goLintFound.push({from: CodeMirror.Pos(lint.lineNo, 0),
|
||||||
to: CodeMirror.Pos(lint.lineNo, 0),
|
to: CodeMirror.Pos(lint.lineNo, 0),
|
||||||
message: lint.msg, severity: lint.severity});
|
message: lint.msg, severity: lint.severity});
|
||||||
|
|
||||||
|
files[lint.file] = lint.file;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".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);
|
||||||
}
|
|
||||||
|
|
||||||
// trigger gutter lint
|
// trigger gutter lint
|
||||||
CodeMirror.signal(wide.curEditor, "change", wide.curEditor);
|
for (var path in files) {
|
||||||
|
var editor = editors.getEditorByPath(path);
|
||||||
|
CodeMirror.signal(editor, "change", editor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue