report line:ch in live-preview errors for usercss
This commit is contained in:
parent
66704a78b3
commit
dbba338229
|
@ -623,6 +623,10 @@ onDOMscriptReady('/codemirror.js').then(() => {
|
|||
}).then(() => {
|
||||
errors.classList.add('hidden');
|
||||
}).catch(err => {
|
||||
if (err && editor && !Number.isNaN(err.index)) {
|
||||
const pos = editors[0].posFromIndex(err.index);
|
||||
err = `${pos.line}:${pos.ch} ${err}`;
|
||||
}
|
||||
errors.classList.remove('hidden');
|
||||
errors.onclick = () => messageBox.alert(String(err), 'pre');
|
||||
});
|
||||
|
|
|
@ -450,8 +450,8 @@ var usercss = (() => {
|
|||
try {
|
||||
doParse();
|
||||
} catch (e) {
|
||||
// grab additional info
|
||||
e.index = metaIndex;
|
||||
// the source code string offset
|
||||
e.index = metaIndex + state.re.lastIndex;
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user