Skip to content

Commit 3c39537

Browse files
committed
Record pending switches for visual/source mode in Positron
1 parent cddc812 commit 3c39537

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ export async function reopenEditorInVisualMode(
121121
viewColumn?: ViewColumn
122122
) {
123123
if (hasHooks()) {
124+
// note pending switch to visual
125+
VisualEditorProvider.recordPendingSwitchToVisual(document);
124126
commands.executeCommand('positron.reopenWith', document.uri, 'quarto.visualEditor');
125127
} else {
126128
// save then close
@@ -144,6 +146,9 @@ export async function reopenEditorInSourceMode(
144146
viewColumn?: ViewColumn
145147
) {
146148
if (hasHooks()) {
149+
// note pending switch to source
150+
VisualEditorProvider.recordPendingSwitchToSource(document);
151+
147152
commands.executeCommand('positron.reopenWith', document.uri, 'default');
148153
} else {
149154
if (!document.isUntitled) {

0 commit comments

Comments
 (0)