From 01aae07a6dd4206582d80dfa3a5dc13320ebcc91 Mon Sep 17 00:00:00 2001 From: Mohammed Alamri Date: Tue, 11 Oct 2022 17:54:25 +0300 Subject: [PATCH] a potential fix to #63 --- package.json | 2 +- src/decorator.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1bc0799..db57ce1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Inline fold", "description": "A custom decorator that \"fold\" matching content in single line", "icon": "res/icon.png", - "version": "0.1.9", + "version": "0.1.10", "publisher": "moalamri", "homepage": "https://github.com/moalamri/vscode-inline-fold", "bugs": "https://github.com/moalamri/vscode-inline-fold/issues", diff --git a/src/decorator.ts b/src/decorator.ts index 88217fd..b392c5b 100644 --- a/src/decorator.ts +++ b/src/decorator.ts @@ -89,6 +89,8 @@ export class Decorator { let match; while (match = regEx.exec(text)) { + if(match && !match[regexGroup]) continue; + const matched = match[regexGroup]; const foldIndex = match[0].lastIndexOf(matched); const startPosition = this.startPositionLine(match.index, foldIndex);