File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
packages/cursorless-org-docs/src/docs/user/languages/components Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,7 @@ function renderFixture(
7171 rangeType === "content"
7272 ? scope . content
7373 : ( scope . removal ?? scope . content ) ;
74- const range = Range . fromConcise ( conciseRange ) ;
75-
76- // TODO: fix overlapping ranges
77- if ( previousRange != null && previousRange . intersection ( range ) != null ) {
78- // If the previous range intersects with the current range, we skip
79- // highlighting the current range to avoid overlapping highlights
80- break ;
81- }
74+ let range = Range . fromConcise ( conciseRange ) ;
8275
8376 if ( scope . domain != null && scope . domain !== conciseRange ) {
8477 highlights . push ( {
@@ -87,6 +80,19 @@ function renderFixture(
8780 } ) ;
8881 }
8982
83+ if ( previousRange != null ) {
84+ const intersection = previousRange . intersection ( range ) ;
85+
86+ if ( intersection != null && ! intersection . isEmpty ) {
87+ highlights . push ( {
88+ type : rangeType ,
89+ range : intersection ,
90+ } ) ;
91+
92+ range = new Range ( intersection . end , range . end ) ;
93+ }
94+ }
95+
9096 highlights . push ( {
9197 type : rangeType ,
9298 range,
You can’t perform that action at this time.
0 commit comments