Skip to content

Commit 2a31c7d

Browse files
author
aiday-mar
committed
Changes from review
1 parent 9f7ddb2 commit 2a31c7d

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ export class ClickLinkGesture extends Disposable {
113113
private _hasTriggerKeyOnMouseDown: boolean;
114114
private _lineNumberOnMouseDown: number;
115115

116-
constructor(editor: ICodeEditor, _alwaysFireOnMouseUp?: boolean) {
116+
constructor(editor: ICodeEditor, alwaysFireOnMouseUp?: boolean) {
117117
super();
118118

119119
this._editor = editor;
120-
this._alwaysFireExecuteOnMouseUp = _alwaysFireOnMouseUp;
120+
this._alwaysFireExecuteOnMouseUp = alwaysFireOnMouseUp;
121121
this._opts = createOptions(this._editor.getOption(EditorOption.multiCursorModifier));
122122

123123
this._lastMouseMoveEvent = null;

src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
4545
private _lastLineRelativePosition: number;
4646
private _hoverOnLine: number;
4747
private _hoverOnColumn: number;
48-
private _stickyRangeProjectedOnEditor: IRange;
48+
private _stickyRangeProjectedOnEditor: IRange | undefined;
4949

5050
constructor(
5151
private readonly _editor: ICodeEditor,
@@ -61,7 +61,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
6161
this._lastLineRelativePosition = 0;
6262
this._hoverOnLine = -1;
6363
this._hoverOnColumn = -1;
64-
this._stickyRangeProjectedOnEditor = {} as IRange;
64+
this._stickyRangeProjectedOnEditor = undefined;
6565
this._lineHeight = this._editor.getOption(EditorOption.lineHeight);
6666
this._register(this._editor.onDidChangeConfiguration(e => {
6767
if (e.hasChanged(EditorOption.lineHeight)) {
@@ -87,7 +87,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
8787
return;
8888
}
8989
const targetMouseEvent = mouseEvent.target as unknown as CustomMouseEvent;
90-
if (targetMouseEvent.detail === 'editor.contrib.stickyScrollWidget' && targetMouseEvent.element.innerText === targetMouseEvent.element.innerHTML) {
90+
if (targetMouseEvent.detail === this.getId() && targetMouseEvent.element.innerText === targetMouseEvent.element.innerHTML) {
9191
const text = targetMouseEvent.element.innerText;
9292
if (this._hoverOnColumn === -1) {
9393
return;
@@ -111,18 +111,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
111111
return;
112112
}
113113
if (candidateDefinitions.length !== 0) {
114-
const lineToDecorate = this.getDomNode().getElementsByClassName(`stickyLine${lineNumber}`)[0].children[0] as HTMLElement;
115-
let childHTML: HTMLElement | undefined = undefined;
116-
for (const childElement of lineToDecorate.children) {
117-
const childAsHTMLElement = childElement as HTMLElement;
118-
if (childAsHTMLElement.innerText === text) {
119-
childHTML = childAsHTMLElement;
120-
break;
121-
}
122-
}
123-
if (!childHTML) {
124-
return;
125-
}
114+
const childHTML: HTMLElement = targetMouseEvent.element;
126115
if (currentHTMLChild !== childHTML) {
127116
sessionStore.clear();
128117
currentHTMLChild = childHTML;

0 commit comments

Comments
 (0)