mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
fixes #122402
This commit is contained in:
parent
427f48b8d1
commit
edf85f1711
|
@ -660,9 +660,15 @@ export class MouseController<T> implements IDisposable {
|
|||
|
||||
private changeSelection(e: IListMouseEvent<T> | IListTouchEvent<T>): void {
|
||||
const focus = e.index!;
|
||||
const anchor = this.list.getAnchor();
|
||||
let anchor = this.list.getAnchor();
|
||||
|
||||
if (this.isSelectionRangeChangeEvent(e)) {
|
||||
if (typeof anchor === 'undefined') {
|
||||
const currentFocus = this.list.getFocus()[0];
|
||||
anchor = currentFocus ?? focus;
|
||||
this.list.setAnchor(anchor);
|
||||
}
|
||||
|
||||
if (this.isSelectionRangeChangeEvent(e) && typeof anchor === 'number') {
|
||||
const min = Math.min(anchor, focus);
|
||||
const max = Math.max(anchor, focus);
|
||||
const rangeSelection = range(min, max + 1);
|
||||
|
|
Loading…
Reference in a new issue