use normal warning if typo candidate is empty

This commit is contained in:
tophf 2021-09-07 12:40:06 +03:00
parent 048c267266
commit e7d5fff736

View File

@ -329,7 +329,7 @@ function SourceEditor() {
} }
cache = errors.map(({code, index, args, message}) => { cache = errors.map(({code, index, args, message}) => {
const isUnknownMeta = code === 'unknownMeta'; const isUnknownMeta = code === 'unknownMeta';
const typo = isUnknownMeta && args.length === 2 ? 'Typo' : ''; const typo = isUnknownMeta && args[1] ? 'Typo' : ''; // args[1] may be present but undefined
return ({ return ({
from: cm.posFromIndex((index || 0) + match.index), from: cm.posFromIndex((index || 0) + match.index),
to: cm.posFromIndex((index || 0) + match.index), to: cm.posFromIndex((index || 0) + match.index),