Skip to content

Commit 7132e19

Browse files
committed
Undo onDidSaveTextDocument that causes problems for _all_ files
1 parent c1b6c27 commit 7132e19

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

apps/vscode/src/providers/editor/toggle.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,18 @@ export async function reopenEditorInVisualMode(
129129
// reopen in visual mode
130130
commands.executeCommand('positron.reopenWith', document.uri, 'quarto.visualEditor');
131131
} else {
132-
workspace.onDidSaveTextDocument(async (doc: TextDocument) => {
133-
// open in visual mode
134-
VisualEditorProvider.recordPendingSwitchToVisual(doc);
135-
await commands.executeCommand('workbench.action.closeActiveEditor');
136-
await commands.executeCommand("vscode.openWith",
137-
doc.uri,
138-
VisualEditorProvider.viewType,
139-
{ viewColumn }
140-
);
141-
});
142-
// save, which will trigger `onDidSaveTextDocument`
132+
// save then close
143133
await commands.executeCommand("workbench.action.files.save");
134+
await commands.executeCommand('workbench.action.closeActiveEditor');
135+
VisualEditorProvider.recordPendingSwitchToVisual(document);
136+
137+
// open in visual mode
138+
await commands.executeCommand(
139+
"vscode.openWith",
140+
document.uri,
141+
VisualEditorProvider.viewType,
142+
{ viewColumn }
143+
);
144144
}
145145
}
146146

0 commit comments

Comments
 (0)