Skip to content
Snippets Groups Projects
Commit 3b3c44e0 authored by George Nachman's avatar George Nachman
Browse files

Remove preference to permanently silence multiline paste warning if the...

Remove preference to permanently silence multiline paste warning if the default action is cancel. Issue 5115.
parent e60f4abc
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -521,6 +521,10 @@ const int kNumberOfSpacesPerTabNoConversion = -1;
theTitle = @"OK to paste one line ending in a newline?";
}
}
// Issue 5115
[iTermWarning unsilenceIdentifier:identifier ifSelectionEquals:[actions indexOfObjectIdenticalTo:cancel]];
iTermWarning *warning = [[[iTermWarning alloc] init] autorelease];
warning.title = theTitle;
warning.warningActions = actions;
Loading
Loading
Loading
Loading
@@ -51,6 +51,9 @@ typedef void(^iTermWarningActionBlock)(iTermWarningSelection);
 
@interface iTermWarning : NSObject
 
// Used to unsilence a particular selection (e.g., when you have a bug and silence the Cancel selection).
+ (void)unsilenceIdentifier:(NSString *)identifier ifSelectionEquals:(iTermWarningSelection)problemSelection;
// Tests can use this to prevent warning popups.
+ (void)setWarningHandler:(id<iTermWarningHandler>)handler;
+ (id<iTermWarningHandler>)warningHandler;
Loading
Loading
Loading
Loading
@@ -154,6 +154,15 @@ static BOOL gShowingWarning;
return selection;
}
 
+ (void)unsilenceIdentifier:(NSString *)identifier ifSelectionEquals:(iTermWarningSelection)problemSelection {
if ([self identifierIsSilenced:identifier] &&
[self savedSelectionForIdentifier:identifier] == problemSelection) {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
NSString *theKey = [self permanentlySilenceKeyForIdentifier:identifier];
[userDefaults removeObjectForKey:theKey];
}
}
// Does not invoke the warning action's block
- (iTermWarningSelection)runModalImpl {
if (!gWarningHandler &&
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment