mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-21 04:20:11 -04:00
Merge from vscode 4f85c3c94c15457e1d4c9e67da6800630394ea54 (#8757)
* Merge from vscode 4f85c3c94c15457e1d4c9e67da6800630394ea54 * disable failing tests
This commit is contained in:
@@ -32,6 +32,7 @@ import { InitializingRangeProvider, ID_INIT_PROVIDER } from 'vs/editor/contrib/f
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
|
||||
|
||||
const CONTEXT_FOLDING_ENABLED = new RawContextKey<boolean>('foldingEnabled', false);
|
||||
|
||||
@@ -421,8 +422,12 @@ export class FoldingController extends Disposable implements IEditorContribution
|
||||
if (region && region.startLineNumber === lineNumber) {
|
||||
let isCollapsed = region.isCollapsed;
|
||||
if (iconClicked || isCollapsed) {
|
||||
let toToggle = [region];
|
||||
if (e.event.middleButton || e.event.shiftKey) {
|
||||
let toToggle = [];
|
||||
let considerRegionsInside = this.shouldConsiderRegionsInside(e.event);
|
||||
if (isCollapsed || (!isCollapsed && !considerRegionsInside)) {
|
||||
toToggle.push(region);
|
||||
}
|
||||
if (considerRegionsInside) {
|
||||
toToggle.push(...foldingModel.getRegionsInside(region, (r: FoldingRegion) => r.isCollapsed === isCollapsed));
|
||||
}
|
||||
foldingModel.toggleCollapseState(toToggle);
|
||||
@@ -433,6 +438,10 @@ export class FoldingController extends Disposable implements IEditorContribution
|
||||
}).then(undefined, onUnexpectedError);
|
||||
}
|
||||
|
||||
private shouldConsiderRegionsInside(event: IMouseEvent): boolean {
|
||||
return event.middleButton || event.shiftKey;
|
||||
}
|
||||
|
||||
public reveal(position: IPosition): void {
|
||||
this.editor.revealPositionInCenterIfOutsideViewport(position, ScrollType.Smooth);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user