From d6535603e3c048b84e73446bf93dea6106c6ef17 Mon Sep 17 00:00:00 2001 From: FlorianWoelki Date: Sat, 20 Jul 2024 10:19:24 +0200 Subject: [PATCH] refactor: issue with undefined offset --- src/editor/state.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor/state.ts b/src/editor/state.ts index 1f819b4..8412449 100644 --- a/src/editor/state.ts +++ b/src/editor/state.ts @@ -63,8 +63,8 @@ function iterateSymbolsRanges( )) { const prettified = characterMap[symbol]?.transform ?? symbol; addToRange( - from + offset, - from + offset + symbol.length, + from + (offset ?? 0), + from + (offset ?? 0) + symbol.length, new SymbolsPosition(symbol, prettified), ); }