From b35db4827da20b211a0f1ebddbae5ecec5d3536a Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Thu, 18 May 2023 14:30:32 +0100 Subject: [PATCH] Merge pull request #13120 from overleaf/dk-drawselection-cm-patch [cm6] apply cm patch for drawSelection bug GitOrigin-RevId: 3adfcdbea4cc18d2cc197c153323fc62bafc364f --- .../web/frontend/js/features/source-editor/utils/layer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/source-editor/utils/layer.ts b/services/web/frontend/js/features/source-editor/utils/layer.ts index 8e96ecb39d..7f3bbc8701 100644 --- a/services/web/frontend/js/features/source-editor/utils/layer.ts +++ b/services/web/frontend/js/features/source-editor/utils/layer.ts @@ -173,7 +173,10 @@ function rectanglesForRange( : drawForWidget(endBlock, true) const between = [] - if ((visualStart || startBlock).to < (visualEnd || endBlock).from - 1) + if ( + (visualStart || startBlock).to < + (visualEnd || endBlock).from - (visualStart && visualEnd ? 1 : 0) + ) between.push(piece(leftSide, top.bottom, rightSide, bottom.top)) else if ( top.bottom < bottom.top &&