diff --git a/AppController.m b/AppController.m index 3898ab0..168f7f6 100755 --- a/AppController.m +++ b/AppController.m @@ -1187,16 +1187,21 @@ - (void)processBezelKeyDown:(NSEvent *)theEvent { case 's': case 'S': // Save / Save-and-delete { bool success = [flycutOperator saveFromStack]; - [self performSelector:@selector(hideApp) withObject:nil afterDelay:0.2]; - [self restoreStashedStoreAndUpdate]; - if ( success ) { - if ( modifiers & NSEventModifierFlagShift ) { - [flycutOperator clearItemAtStackPosition]; - [self updateBezel]; - [self updateMenu]; - } + // Delete while the store that was saved from is still the current one. + // -restoreStashedStore swaps the store AND the stack position back, so + // deleting after it removed an entry from the main list - at whatever + // position the user had been at there - instead of the clipping that had + // just been saved. Saving a favorite therefore destroyed an unrelated + // clipping. + if ( success && ( modifiers & NSEventModifierFlagShift ) ) { + [flycutOperator clearItemAtStackPosition]; + [self updateBezel]; + [self updateMenu]; } + + [self performSelector:@selector(hideApp) withObject:nil afterDelay:0.2]; + [self restoreStashedStoreAndUpdate]; } break; case 'f':