mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
list: select element when increasing selection range. Do not select element when removing it from selection
fixes #43233
This commit is contained in:
parent
e47770acea
commit
5dc3c59343
|
@ -462,15 +462,18 @@ class MouseController<T> implements IDisposable {
|
|||
}
|
||||
|
||||
let reference = this.list.getFocus()[0];
|
||||
reference = reference === undefined ? this.list.getSelection()[0] : reference;
|
||||
const selection = this.list.getSelection();
|
||||
reference = reference === undefined ? selection[0] : reference;
|
||||
|
||||
const focus = e.index;
|
||||
if (selection.every(s => s !== focus)) {
|
||||
this.list.setFocus([focus]);
|
||||
}
|
||||
|
||||
if (this.multipleSelectionSupport && this.isSelectionRangeChangeEvent(e)) {
|
||||
return this.changeSelection(e, reference);
|
||||
}
|
||||
|
||||
const focus = e.index;
|
||||
this.list.setFocus([focus]);
|
||||
|
||||
if (this.multipleSelectionSupport && this.isSelectionChangeEvent(e)) {
|
||||
return this.changeSelection(e, reference);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue