Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/vs/workbench/contrib/outline/browser/outlinePane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,19 @@ export class OutlinePane extends ViewPane implements IOutlinePane {
this._editorControlDisposables.add(tree.onDidOpen(async e => {
const myId = ++idPool;
const isDoubleClick = e.browserEvent?.type === 'dblclick';
// when `workbench.list.openMode` is `doubleClick`, a double click is the
// primary way to open an entry and should jump to the symbol (not select
// its full range), matching the single-click behavior in the default mode.
const openOnSingleClick = this.configurationService.getValue('workbench.list.openMode') !== 'doubleClick';
const selectSymbolRange = isDoubleClick && openOnSingleClick;
if (!isDoubleClick) {
// workaround for https://github.com/microsoft/vscode/issues/206424
await timeout(150);
if (myId !== idPool) {
return;
}
}
await newOutline.reveal(e.element, e.editorOptions, e.sideBySide, isDoubleClick);
await newOutline.reveal(e.element, e.editorOptions, e.sideBySide, selectSymbolRange);
}));
// feature: reveal editor selection in outline
const revealActiveElement = () => {
Expand Down