File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
coderibbon-theia/src/browser Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -346,15 +346,36 @@ export class CodeRibbonTheiaRibbonPanel
346
346
// this.addWidget(widget, { mode: 'split-bottom' });
347
347
// break;
348
348
case "widget-all" :
349
+ crdebug ( "patch swap because widget-all drop zone" ) ;
349
350
// TODO swap if from another patch & self not empty
350
351
// this.addWidget(widget, { mode: 'tab-after', ref });
351
352
// this.addWidget(widget, { mode: 'split-down', ref });
352
353
if ( target_patch ) {
353
354
if ( target_patch . contentful_size == 0 ) {
355
+ crdebug ( "target_patch is empty, nothing to swap" ) ;
356
+ target_patch . addWidget ( widget ) ;
357
+ } else {
358
+ crdebug ( "Swapping widgets between patches." ) ;
359
+ let other_widget = target_patch . contentful_widget ;
360
+ if ( ! other_widget ) {
361
+ console . error (
362
+ "CR: attempted to swap patch content but target patch is missing a widget when it was contenful." ,
363
+ ) ;
364
+ break ;
365
+ }
366
+ if ( ! source_patch ) {
367
+ crdebug (
368
+ "patch received a drop from somewhere that wasn't a patch, but we're full right now!" ,
369
+ ) ;
370
+ // TODO what is the desired behavior here?
371
+ // perhaps split-down or split-right?
372
+ break ;
373
+ }
374
+ source_patch . addWidget ( other_widget ) ;
354
375
target_patch . addWidget ( widget ) ;
355
- } else if ( source_patch ) {
356
- // TODO swap their contents
357
376
}
377
+ } else {
378
+ crdebug ( "no target_patch for the drop? where are we going?" ) ;
358
379
}
359
380
break ;
360
381
case "widget-top" :
You can’t perform that action at this time.
0 commit comments