mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Introduce plug-in blacklist which defaults to io.emmet.EmmetTextmate
We have been detecting plug-in crashes for about two years, and we offer the user to remove crashing plug-ins, nonetheless we are still getting a significant number of crash reports from loading the Emmet plug-in.
This commit is contained in:
@@ -11,6 +11,7 @@ OAK_DEBUG_VAR(PlugInController);
|
||||
|
||||
static TMPlugInController* SharedInstance;
|
||||
static NSInteger const kPlugInAPIVersion = 2;
|
||||
static NSString* const kUserDefaultsDisabledPlugInsKey = @"disabledPlugIns";
|
||||
|
||||
@interface TMPlugInController ()
|
||||
@property (nonatomic) NSMutableDictionary* loadedPlugIns;
|
||||
@@ -33,6 +34,13 @@ static id CreateInstanceOfPlugInClass (Class cl, TMPlugInController* controller)
|
||||
return SharedInstance ?: [TMPlugInController new];
|
||||
}
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:@{
|
||||
kUserDefaultsDisabledPlugInsKey : @[ @"io.emmet.EmmetTextmate" ]
|
||||
}];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if(SharedInstance)
|
||||
@@ -58,6 +66,10 @@ static id CreateInstanceOfPlugInClass (Class cl, TMPlugInController* controller)
|
||||
NSString* identifier = [bundle objectForInfoDictionaryKey:@"CFBundleIdentifier"];
|
||||
NSString* name = [bundle objectForInfoDictionaryKey:@"CFBundleName"];
|
||||
|
||||
NSArray* blacklist = [[NSUserDefaults standardUserDefaults] arrayForKey:kUserDefaultsDisabledPlugInsKey];
|
||||
if([blacklist containsObject:identifier])
|
||||
return;
|
||||
|
||||
if(![self.loadedPlugIns objectForKey:identifier])
|
||||
{
|
||||
if([[bundle objectForInfoDictionaryKey:@"TMPlugInAPIVersion"] intValue] == kPlugInAPIVersion)
|
||||
|
||||
Reference in New Issue
Block a user