mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
fixes #26184
This commit is contained in:
committed by
Dirk Baeumer
parent
fff0136ca6
commit
a0a1b9e0d6
@@ -321,6 +321,7 @@ class MouseController<T> implements IDisposable {
|
||||
this.disposables = [];
|
||||
this.disposables.push(view.addListener('mousedown', e => this.onMouseDown(e)));
|
||||
this.disposables.push(view.addListener('click', e => this.onPointer(e)));
|
||||
this.disposables.push(view.addListener('dblclick', e => this.onDoubleClick(e)));
|
||||
this.disposables.push(view.addListener(TouchEventType.Tap, e => this.onPointer(e)));
|
||||
}
|
||||
|
||||
@@ -362,6 +363,19 @@ class MouseController<T> implements IDisposable {
|
||||
this.list.open(focus);
|
||||
}
|
||||
|
||||
private onDoubleClick(e: IListMouseEvent<T>): void {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
if (isSelectionChangeEvent(e)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const focus = this.list.getFocus();
|
||||
this.list.setSelection(focus);
|
||||
this.list.pin(focus);
|
||||
}
|
||||
|
||||
private changeSelection(e: IListMouseEvent<T>, reference: number | undefined): void {
|
||||
const focus = e.index;
|
||||
|
||||
@@ -574,6 +588,11 @@ export class List<T> implements ISpliceable<T>, IDisposable {
|
||||
return mapEvent(this._onOpen.event, indexes => this.toListEvent({ indexes }));
|
||||
}
|
||||
|
||||
private _onPin = new Emitter<number[]>();
|
||||
@memoize get onPin(): Event<IListEvent<T>> {
|
||||
return mapEvent(this._onPin.event, indexes => this.toListEvent({ indexes }));
|
||||
}
|
||||
|
||||
private _onDOMFocus = new Emitter<void>();
|
||||
get onDOMFocus(): Event<void> { return this._onDOMFocus.event; }
|
||||
|
||||
@@ -813,6 +832,10 @@ export class List<T> implements ISpliceable<T>, IDisposable {
|
||||
this._onOpen.fire(indexes);
|
||||
}
|
||||
|
||||
pin(indexes: number[]): void {
|
||||
this._onPin.fire(indexes);
|
||||
}
|
||||
|
||||
style(styles: IListStyles): void {
|
||||
const content: string[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user