From 89bd40a66a2f06fb8806f174e5559021540a5b1e Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Mon, 26 Aug 2024 11:30:40 +0200 Subject: [PATCH] fix: improve type getMarkerAtPosition markergroup (#5631) --- ace.d.ts | 2 +- src/marker_group.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ace.d.ts b/ace.d.ts index 7e5c9ebf6cb..6fbcbbd1366 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -292,7 +292,7 @@ export namespace Ace { export class MarkerGroup { constructor(session: EditSession, options?: {markerType?: "fullLine" | "line"}); setMarkers(markers: MarkerGroupItem[]): void; - getMarkerAtPosition(pos: Position): MarkerGroupItem; + getMarkerAtPosition(pos: Position): MarkerGroupItem | undefined; } diff --git a/src/marker_group.js b/src/marker_group.js index 160beac9658..45304eb7255 100644 --- a/src/marker_group.js +++ b/src/marker_group.js @@ -36,7 +36,7 @@ class MarkerGroup { /** * Finds the first marker containing pos * @param {import("../ace-internal").Ace.Point} pos - * @returns import("../ace-internal").Ace.MarkerGroupItem + * @returns {import("../ace-internal").Ace.MarkerGroupItem | undefined} */ getMarkerAtPosition(pos) { return this.markers.find(function(marker) {