Merge pull request #38727 from AdenFlorian/master
Support middle mouse click on folding decorator to recursively toggle folding
This commit is contained in:
commit
1cb368d98c
2 changed files with 11 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -12,4 +12,5 @@ out-vscode/
|
|||
out-vscode-min/
|
||||
build/node_modules
|
||||
coverage/
|
||||
test_data/
|
||||
test_data/
|
||||
yarn-error.log
|
|
@ -229,7 +229,10 @@ export class FoldingController implements IEditorContribution {
|
|||
this.mouseDownInfo = null;
|
||||
|
||||
let range = e.target.range;
|
||||
if (!this.hiddenRangeModel || !range || !e.event.leftButton) {
|
||||
if (!this.hiddenRangeModel || !range) {
|
||||
return;
|
||||
}
|
||||
if (!e.event.leftButton && !e.event.middleButton) {
|
||||
return;
|
||||
}
|
||||
let iconClicked = false;
|
||||
|
@ -298,7 +301,11 @@ export class FoldingController implements IEditorContribution {
|
|||
let region = foldingModel.getRegionAtLine(lineNumber);
|
||||
if (region && region.startLineNumber === lineNumber) {
|
||||
if (iconClicked || region.isCollapsed) {
|
||||
foldingModel.toggleCollapseState([region]);
|
||||
if (e.event.middleButton) {
|
||||
setCollapseStateLevelsDown(foldingModel, !region.isCollapsed, Number.MAX_VALUE, [lineNumber]);
|
||||
} else {
|
||||
foldingModel.toggleCollapseState([region]);
|
||||
}
|
||||
this.reveal(lineNumber);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue