From 8b0e036ed567c2476c8c3c40606ea5b1e47a4daf Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Fri, 25 Feb 2022 21:40:30 +0100 Subject: [PATCH] highlight voicings --- repl/src/voicings.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/repl/src/voicings.ts b/repl/src/voicings.ts index 2b641c93..fb2b6f52 100644 --- a/repl/src/voicings.ts +++ b/repl/src/voicings.ts @@ -19,7 +19,7 @@ Pattern.prototype.fmapNested = function (func) { .map((event) => reify(func(event)) .query(span) - .map((hap) => new Hap(event.whole, event.part, hap.value)) + .map((hap) => new Hap(event.whole, event.part, hap.value, hap.context)) ) .flat() ); @@ -33,7 +33,9 @@ Pattern.prototype.voicings = function (range) { } return this.fmapNested((event) => { lastVoicing = getVoicing(event.value, lastVoicing, range); - return stack(...lastVoicing); + return stack(...lastVoicing)._withContext(() => ({ + locations: event.context.locations || [], + })); }); };