Skip to content

Commit ad50303

Browse files
author
Kapil Borle
committed
Make formatting edit as one atomic edit
1 parent 44d7122 commit ad50303

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/features/DocumentFormatter.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ class PSDocumentFormattingEditProvider implements DocumentFormattingEditProvider
9090
"PSUseConsistentIndentation"];
9191

9292
// Allows edits to be undone and redone is a single step.
93-
// Should we expose this through settings?
93+
// It is usefuld to have undo stops after every edit while debugging
94+
// hence we keep this as an option but set it true by default.
9495
private aggregateUndoStop: boolean;
9596

96-
constructor(aggregateUndoStop: boolean) {
97+
constructor(aggregateUndoStop = true) {
9798
this.aggregateUndoStop = aggregateUndoStop;
9899
}
99100

@@ -260,7 +261,7 @@ export class DocumentFormatterFeature implements IFeature {
260261
private documentFormattingEditProvider: PSDocumentFormattingEditProvider;
261262

262263
constructor() {
263-
this.documentFormattingEditProvider = new PSDocumentFormattingEditProvider(true);
264+
this.documentFormattingEditProvider = new PSDocumentFormattingEditProvider();
264265
this.formattingEditProvider = vscode.languages.registerDocumentFormattingEditProvider(
265266
"powershell",
266267
this.documentFormattingEditProvider);

0 commit comments

Comments
 (0)