mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode d06f0e877ceaf3a35a283f1bfdc50927ec8dfd1e (#8767)
This commit is contained in:
@@ -23,17 +23,16 @@
|
||||
}
|
||||
|
||||
.monaco-editor .codelens-decoration > a:hover {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.monaco-editor .codelens-decoration .codicon {
|
||||
line-height: inherit;
|
||||
font-size: inherit;
|
||||
font-size: 110%;
|
||||
vertical-align: inherit;
|
||||
}
|
||||
|
||||
.monaco-editor .codelens-decoration > a:hover .codicon::before {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ 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);
|
||||
|
||||
@@ -423,12 +422,17 @@ export class FoldingController extends Disposable implements IEditorContribution
|
||||
let isCollapsed = region.isCollapsed;
|
||||
if (iconClicked || isCollapsed) {
|
||||
let toToggle = [];
|
||||
let considerRegionsInside = this.shouldConsiderRegionsInside(e.event);
|
||||
if (isCollapsed || (!isCollapsed && !considerRegionsInside)) {
|
||||
toToggle.push(region);
|
||||
let recursive = e.event.middleButton || e.event.shiftKey;
|
||||
if (recursive) {
|
||||
for (const r of foldingModel.getRegionsInside(region)) {
|
||||
if (r.isCollapsed === isCollapsed) {
|
||||
toToggle.push(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (considerRegionsInside) {
|
||||
toToggle.push(...foldingModel.getRegionsInside(region, (r: FoldingRegion) => r.isCollapsed === isCollapsed));
|
||||
// when recursive, first only collapse all children. If all are already folded or there are no children, also fold parent.
|
||||
if (isCollapsed || !recursive || toToggle.length === 0) {
|
||||
toToggle.push(region);
|
||||
}
|
||||
foldingModel.toggleCollapseState(toToggle);
|
||||
this.reveal({ lineNumber, column: 1 });
|
||||
@@ -438,10 +442,6 @@ 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