Skip to content

Commit

Permalink
Zexpose gutter tooltip row information in gutter tooltip class (#5703)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlujjawal authored Dec 20, 2024
1 parent 66a6736 commit 23eeb09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/mouse/default_gutter_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class GutterTooltip extends Tooltip {
constructor(editor) {
super(editor.container);
this.editor = editor;
/**@type {Number | Undefined}*/
this.visibleTooltipRow;
}

setPosition(x, y) {
Expand Down Expand Up @@ -267,6 +269,7 @@ class GutterTooltip extends Tooltip {
}

this.show();
this.visibleTooltipRow = row;
this.editor._signal("showGutterTooltip", this);
}

Expand All @@ -276,6 +279,7 @@ class GutterTooltip extends Tooltip {
}
this.$element.removeAttribute("aria-live");
this.hide();
this.visibleTooltipRow = undefined;
this.editor._signal("hideGutterTooltip", this);
}

Expand Down
3 changes: 2 additions & 1 deletion types/ace-modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ declare module "ace-code/src/virtual_renderer" {
* @param {EditSession} session The session to associate with
**/
setSession(session: EditSession): void;
session: import("ace-code/src/edit_session").EditSession;
session: import("ace-code").Ace.EditSession;
/**
* Triggers a partial update of the text, from the range given by the two parameters.
* @param {Number} firstRow The first row to update
Expand Down Expand Up @@ -1702,6 +1702,7 @@ declare module "ace-code/src/mouse/default_gutter_handler" {
static annotationsToSummaryString(annotations: any): string;
constructor(editor: any);
editor: any;
visibleTooltipRow: number | undefined;
setPosition(x: any, y: any): void;
showTooltip(row: any): void;
hideTooltip(): void;
Expand Down

0 comments on commit 23eeb09

Please sign in to comment.