From e371b7904d359a8144395acd4969fd34bb25cf44 Mon Sep 17 00:00:00 2001 From: kotaindah55 Date: Tue, 4 Feb 2025 00:14:25 +0200 Subject: [PATCH] fix: add another condition for decos set filter Align line decoration that doesn't covered by filter range, even though it was touching it, should not be filtered out. --- src/editor-mode/decorator/builder/DecorationBuilder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor-mode/decorator/builder/DecorationBuilder.ts b/src/editor-mode/decorator/builder/DecorationBuilder.ts index 451aee6..87a9202 100644 --- a/src/editor-mode/decorator/builder/DecorationBuilder.ts +++ b/src/editor-mode/decorator/builder/DecorationBuilder.ts @@ -79,8 +79,8 @@ export class DecorationBuilder { filterTo = (this.parser.tokens[end]?.from ?? docLen); return decoSet.map(update.changes).update({ add: ranges, filterFrom, filterTo, - filter(from, to) { - return (to == filterFrom || from == filterTo) && to != from; + filter(from, to, val) { + return (to == filterFrom || from == filterTo) && ((val.spec.type as Format) <= Format.ALIGN_JUSTIFY || to != from); } }); }