@@ -34,33 +34,40 @@ export const restore_checkpoint = async (params: {
3434 const operation_in_progress = params . context . workspaceState . get < number > (
3535 CHECKPOINT_OPERATION_IN_PROGRESS_STATE_KEY
3636 )
37- if (
38- operation_in_progress &&
39- Date . now ( ) - operation_in_progress < 60 * 1000
40- ) {
37+ if ( operation_in_progress && Date . now ( ) - operation_in_progress < 60 * 1000 ) {
4138 vscode . window . showWarningMessage (
4239 dictionary . warning_message . CHECKPOINT_OPERATION_IN_PROGRESS
4340 )
4441 return
4542 }
4643
47- const tab_groups = vscode . window . tabGroups . all
48- const open_files : {
44+ let open_files : {
4945 uri : vscode . Uri
5046 viewColumn : vscode . ViewColumn
5147 isActive : boolean
5248 } [ ] = [ ]
53- for ( const group of tab_groups ) {
54- for ( const tab of group . tabs ) {
55- if ( tab . input instanceof vscode . TabInputText ) {
56- open_files . push ( {
57- uri : ( tab . input as vscode . TabInputText ) . uri ,
58- viewColumn : group . viewColumn ,
59- isActive : tab . isActive && group . isActive
60- } )
49+
50+ if ( params . checkpoint . active_tabs ) {
51+ open_files = params . checkpoint . active_tabs . map ( ( tab ) => ( {
52+ uri : vscode . Uri . parse ( tab . uri ) ,
53+ viewColumn : tab . view_column as vscode . ViewColumn ,
54+ isActive : tab . is_active && tab . is_group_active
55+ } ) )
56+ } else {
57+ const tab_groups = vscode . window . tabGroups . all
58+ for ( const group of tab_groups ) {
59+ for ( const tab of group . tabs ) {
60+ if ( tab . input instanceof vscode . TabInputText ) {
61+ open_files . push ( {
62+ uri : ( tab . input as vscode . TabInputText ) . uri ,
63+ viewColumn : group . viewColumn ,
64+ isActive : tab . isActive && group . isActive
65+ } )
66+ }
6167 }
6268 }
6369 }
70+
6471 let temp_checkpoint : Checkpoint | undefined
6572 try {
6673 if ( response_preview_promise_resolve ) {
@@ -81,7 +88,7 @@ export const restore_checkpoint = async (params: {
8188 params . context ,
8289 params . panel_provider ,
8390 params . websites_provider ,
84- 'Before checkpoint restored' ,
91+ 'Before checkpoint restored'
8592 )
8693 }
8794
@@ -429,4 +436,3 @@ export const restore_checkpoint = async (params: {
429436 }
430437 }
431438}
432-
0 commit comments