File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed 
apps/vscode/src/providers/editor Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff 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
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments