manual report: autocomplete multiple tags

This commit is contained in:
quenousimporte 2023-10-17 17:11:04 +02:00
parent 6a078efc5b
commit 0dc6adb70e
1 changed files with 7 additions and 5 deletions

12
main.js
View File

@ -2097,11 +2097,13 @@ function applycolorsonline(line, index, options)
if (slashpos > spacepos) if (slashpos > spacepos)
{ {
var snippetpart = raw.substring(slashpos); var snippetpart = raw.substring(slashpos);
var snippet = snippets.find(s => s.command.startsWith(snippetpart)); var matching = snippets
if (snippet) .filter(s => s.command.startsWith(snippetpart))
{ .map(s => s.command.substring(1));
line += "<span style='color:lightgrey'>" + snippet.command.substr(pos - slashpos) + "</span>";
} line += "<span style='color:lightgrey'>";
line += matching.join().substr(pos - slashpos - 1);
line += "</span>";
} }
} }
} }