Skip to content

Commit 91f7e3e

Browse files
committed
fix: show datatips even when there is other overlays such as Linter
1 parent 371cd9c commit 91f7e3e

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/datatip-manager.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff 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), {

0 commit comments

Comments
 (0)