File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -448,21 +448,22 @@ export class DataTipManager {
448448 } )
449449
450450 // 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
452452 const decorations = editor . getOverlayDecorations ( ) . filter ( ( decoration ) => {
453- return decoration . getMarker ( ) . compare ( highlightMarker ) === 1
453+ return decoration . isType ( "highligh" ) && decoration . getMarker ( ) . compare ( highlightMarker ) === 1
454454 } )
455455 if ( decorations . length > 0 ) {
456456 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+ } )
458466 }
459- // END OPTIMIZATION
460-
461- disposables . add ( new Disposable ( ( ) => highlightMarker . destroy ( ) ) )
462- editor . decorateMarker ( highlightMarker , {
463- type : "highlight" ,
464- class : "datatip-highlight-region" ,
465- } )
466467
467468 // The actual datatip should appear at the trigger position.
468469 const overlayMarker = editor . markBufferRange ( new Range ( position , position ) , {
You can’t perform that action at this time.
0 commit comments