mirror of
https://github.com/Microsoft/vscode
synced 2024-09-12 21:24:38 +00:00
Add recursive toggle (#212218)
This commit is contained in:
parent
cb66768ae2
commit
757820ae1a
|
@ -809,6 +809,30 @@ class FoldRecursivelyAction extends FoldingAction<void> {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class ToggleFoldRecursivelyAction extends FoldingAction<void> {
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: 'editor.toggleFoldRecursively',
|
||||
label: nls.localize('toggleFoldRecursivelyAction.label', "Toggle Fold Recursively"),
|
||||
alias: 'Toggle Fold Recursively',
|
||||
precondition: CONTEXT_FOLDING_ENABLED,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyL),
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
invoke(_foldingController: FoldingController, foldingModel: FoldingModel, editor: ICodeEditor): void {
|
||||
const selectedLines = this.getSelectedLines(editor);
|
||||
toggleCollapseState(foldingModel, Number.MAX_VALUE, selectedLines);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class FoldAllBlockCommentsAction extends FoldingAction<void> {
|
||||
|
||||
constructor() {
|
||||
|
@ -1189,6 +1213,7 @@ registerEditorAction(UnfoldAction);
|
|||
registerEditorAction(UnFoldRecursivelyAction);
|
||||
registerEditorAction(FoldAction);
|
||||
registerEditorAction(FoldRecursivelyAction);
|
||||
registerEditorAction(ToggleFoldRecursivelyAction);
|
||||
registerEditorAction(FoldAllAction);
|
||||
registerEditorAction(UnfoldAllAction);
|
||||
registerEditorAction(FoldAllBlockCommentsAction);
|
||||
|
|
Loading…
Reference in a new issue