From 0dc6adb70e176a29cb98d92e5b1a2dafb1aa46ca Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Tue, 17 Oct 2023 17:11:04 +0200 Subject: [PATCH] manual report: autocomplete multiple tags --- main.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 2e1ce8b..e545e49 100644 --- a/main.js +++ b/main.js @@ -2097,11 +2097,13 @@ function applycolorsonline(line, index, options) if (slashpos > spacepos) { var snippetpart = raw.substring(slashpos); - var snippet = snippets.find(s => s.command.startsWith(snippetpart)); - if (snippet) - { - line += "" + snippet.command.substr(pos - slashpos) + ""; - } + var matching = snippets + .filter(s => s.command.startsWith(snippetpart)) + .map(s => s.command.substring(1)); + + line += ""; + line += matching.join().substr(pos - slashpos - 1); + line += ""; } } }