diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.ts index 1a3f8926c10..0be9f4f0502 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.ts @@ -146,7 +146,6 @@ export class InlineChatEditorAffordance extends Disposable implements IContentWi private readonly _domNode: HTMLElement; private _position: IContentWidgetPosition | null = null; private _isVisible = false; - private _currentSelection: Selection | undefined; private readonly _onDidRunAction = this._store.add(new Emitter()); readonly onDidRunAction: Event = this._onDidRunAction.event; @@ -187,7 +186,6 @@ export class InlineChatEditorAffordance extends Disposable implements IContentWi this._store.add(autorun(r => { const sel = selection.read(r); - this._currentSelection = sel; if (sel) { this._show(sel); } else { @@ -196,7 +194,7 @@ export class InlineChatEditorAffordance extends Disposable implements IContentWi })); this._store.add(this._editor.onDidScrollChange(() => { - const sel = this._currentSelection; + const sel = selection.get(); if (!sel) { return; }