diff --git a/hookSublimeText/.gitignore b/hookSublimeText/.gitignore new file mode 100644 index 0000000..6de5836 --- /dev/null +++ b/hookSublimeText/.gitignore @@ -0,0 +1,26 @@ +# Xcode +.DS_Store +#build file +build/ +#personal settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +#xcode state +*.perspectivev3 +!default.perspectivev3 +*.xcworkspace +!default.xcworkspace +xcuserdata +profile +*.moved-aside +DerivedData +.idea/ + +# local path bin +bin/ + +UserInterface.xcuserstate \ No newline at end of file diff --git a/hookSublimeText/hookSublimeText/Main.m b/hookSublimeText/hookSublimeText/Main.m index aa6c241..4d156b6 100644 --- a/hookSublimeText/hookSublimeText/Main.m +++ b/hookSublimeText/hookSublimeText/Main.m @@ -33,7 +33,7 @@ - (void)m_st_commandLine:(id)arg1 { // - PXWindow - (void)m_st_update { - // NSLog(@"SublimeText m_st_update"); + NSLog(@"SublimeText m_st_update"); [self m_st_update]; [self m_hidden_registerMarkView]; } @@ -42,7 +42,9 @@ - (void)m_hidden_registerMarkView { NSDictionary *mark = [[NSUserDefaults standardUserDefaults] objectForKey:@"removedMark"]; if (mark) { if ([[mark allKeys] containsObject:[self m_set_key]]) { - return; + __unused NSNumber *num = [mark valueForKey:[self m_set_key]]; + //TODO + //return; } } @@ -54,6 +56,8 @@ - (void)m_hidden_registerMarkView { for (id item in titleBars) { [self m_hidden_registerMarkView:item]; } + + [self m_set_removeMark]; } // Sublime Text 里有一个同名的c函数🐶 @@ -115,12 +119,13 @@ - (void)m_hidden_registerMarkView:(id)titleBarView { NSTextField *txtView = (NSTextField *)item; if ([txtView.stringValue isEqualToString:@"UNREGISTERED"]) { - [txtView removeFromSuperview]; + // [txtView removeFromSuperview]; + // [txtView setHidden:YES]; + + [txtView setFrame:NSMakeRect(0, 0, 0, 0)]; } } } - - [self m_set_removeMark]; } - (NSString *)m_set_key { @@ -129,9 +134,8 @@ - (NSString *)m_set_key { } - (void)m_set_removeMark { - NSMutableDictionary *mark = @{}.mutableCopy; - [mark setValue:@"1" forKey:[self m_set_key]]; + [mark setValue:@1 forKey:[self m_set_key]]; [[NSUserDefaults standardUserDefaults] setObject:mark forKey:@"removedMark"]; [[NSUserDefaults standardUserDefaults] synchronize];