File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 22
33## 1.123.0 (unreleased)
44
5+ - Fixed a bug with switching between source and visual editors in Positron (< https://github.com/quarto-dev/quarto/pull/732 > ).
56
67## 1.122.0 (Release on 2025-05-26)
78
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ export class VisualEditorProvider implements CustomTextEditorProvider {
175175 // as the tab in `window.tabGroups`, so if we try and close `tab` we
176176 // get a "tab not found" error. The one we care about does exist, but we have
177177 // manually find it via URI, which is a stable field to match on.
178- if ( editorMode && editorMode != viewType && ! isSwitch ) {
178+ if ( editorMode && editorMode !== viewType && ! isSwitch ) {
179179 const allTabs = window . tabGroups . all . flatMap ( group => group . tabs ) ;
180180
181181 // find tab to close if swapping editor type
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments