Add: gotoLintIssue

This commit is contained in:
eight 2018-09-01 15:05:29 +08:00
parent 5ec82adaf9
commit 60776fc782

View File

@ -30,11 +30,11 @@ var linterReport = (() => { // eslint-disable-line no-var
} }
}); });
// document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
// $('#lint-help').addEventListener('click', showLintHelp); $('#lint-help').addEventListener('click', showLintHelp);
// $('#lint').addEventListener('click', gotoLintIssue); $('#linter-settings').addEventListener('click', showLintConfig);
// $('#linter-settings').addEventListener('click', showLintConfig); }, {once: true});
// }, {once: true});
return {refresh}; return {refresh};
function findNextSibling(cms, cm) { function findNextSibling(cms, cm) {
@ -102,7 +102,7 @@ var linterReport = (() => { // eslint-disable-line no-var
const message = $create('td', {attributes: {role: 'message'}}); const message = $create('td', {attributes: {role: 'message'}});
const trElement = $create('tr', { const trElement = $create('tr', {
onclick: () => gotoLintIssue(anno) onclick: () => gotoLintIssue(cm, anno)
}, [ }, [
severity, severity,
line, line,
@ -129,9 +129,13 @@ var linterReport = (() => { // eslint-disable-line no-var
} }
} }
function showLintHelp() {} function gotoLintIssue(cm, anno) {
makeSectionVisible(cm);
cm.focus();
cm.setSelection(anno.from);
}
function gotoLintIssue() {} function showLintHelp() {}
function showLintConfig() {} function showLintConfig() {}
})(); })();