File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -448,21 +448,22 @@ export class DataTipManager {
448
448
} )
449
449
450
450
// OPTIMIZATION:
451
- // if there is an overlay already on the same position, skip showing the datatip
451
+ // if there is an highligh overlay already on the same position, skip adding the highlight
452
452
const decorations = editor . getOverlayDecorations ( ) . filter ( ( decoration ) => {
453
- return decoration . getMarker ( ) . compare ( highlightMarker ) === 1
453
+ return decoration . isType ( "highligh" ) && decoration . getMarker ( ) . compare ( highlightMarker ) === 1
454
454
} )
455
455
if ( decorations . length > 0 ) {
456
456
highlightMarker . destroy ( )
457
- return this . dataTipMarkerDisposables
457
+ // END OPTIMIZATION
458
+ } else {
459
+ // Actual Highlighting
460
+ disposables . add ( new Disposable ( ( ) => highlightMarker . destroy ( ) ) )
461
+
462
+ editor . decorateMarker ( highlightMarker , {
463
+ type : "highlight" ,
464
+ class : "datatip-highlight-region" ,
465
+ } )
458
466
}
459
- // END OPTIMIZATION
460
-
461
- disposables . add ( new Disposable ( ( ) => highlightMarker . destroy ( ) ) )
462
- editor . decorateMarker ( highlightMarker , {
463
- type : "highlight" ,
464
- class : "datatip-highlight-region" ,
465
- } )
466
467
467
468
// The actual datatip should appear at the trigger position.
468
469
const overlayMarker = editor . markBufferRange ( new Range ( position , position ) , {
You can’t perform that action at this time.
0 commit comments