From 417adf448991992ba1aff9a8758c9bb8da8fcb04 Mon Sep 17 00:00:00 2001 From: Kai Saba Date: Tue, 3 Dec 2024 15:59:56 +0100 Subject: [PATCH] fix: prevent edit when uneditable range and selected range intersect or touch --- src/tools.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools.ts b/src/tools.ts index f7a4356..ebad539 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -122,7 +122,7 @@ function lockCodeUsingDecoration ( return true } return withDecoration - ? ranges.every((uneditableRange) => !uneditableRange.containsRange(range)) + ? ranges.every((uneditableRange) => !monaco.Range.areIntersecting(uneditableRange, range)) : ranges.some((editableRange) => editableRange.containsRange(range)) }