Skip to content

Commit

Permalink
focus owning editor when clicking into zone without having editor wid…
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken authored May 16, 2024
1 parent 660fe60 commit 743fdd9
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Dimension } from 'vs/base/browser/dom';
import { addDisposableListener, Dimension } from 'vs/base/browser/dom';
import * as aria from 'vs/base/browser/ui/aria/aria';
import { toDisposable } from 'vs/base/common/lifecycle';
import { assertType } from 'vs/base/common/types';
Expand Down Expand Up @@ -81,6 +81,13 @@ export class InlineChatZoneWidget extends ZoneWidget {
this._disposables.add(this.widget);
this.create();

this._disposables.add(addDisposableListener(this.domNode, 'click', e => {
if (!this.editor.hasWidgetFocus() && !this.widget.hasFocus()) {
this.editor.focus();
}
}, true));


// todo@jrieken listen ONLY when showing
const updateCursorIsAboveContextKey = () => {
if (!this.position || !this.editor.hasModel()) {
Expand Down

0 comments on commit 743fdd9

Please sign in to comment.