XVimProject / XVim2

Vim key-bindings for Xcode 9
MIT License
2.31k stars 182 forks source link

Xcode 12 beta crashes after loading xvim2 plugin #301

Closed webcpu closed 3 years ago

webcpu commented 4 years ago

Xcode version: Xcode 12 beta branch: origin/develop

I have updated DVTPlugInCompatibilityUUIDs.

Once Xcode 12 beta crashes, it will always crash. You have to delete xvim2 plugin and skip it when you running Xcode, otherwise you can't launch Xcode. The plugin causes

defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-12.0

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

ID Vend/Dev 5df6 67df1002 Seconds Ago ID Type 17000.0 5df6 Attach

Application Specific Information: ProductBuildVersion: 12A6159 UNCAUGHT EXCEPTION (NSInvalidArgumentException): -[SourceEditorScrollView additionalContentInsets]: unrecognized selector sent to instance 0x7f826d8c3e00 UserInfo: (null) Open FDs: 57/9472 Hints:

Backtrace: 0 exceptionPreprocess (in CoreFoundation) 1 DVTFailureHintExceptionPreprocessor (in DVTFoundation) 2 objc_exception_throw (in libobjc.A.dylib) 3 -[NSObject(NSObject) retain_OA] (in CoreFoundation) 4 forwarding (in CoreFoundation) 5 forwarding_prep_1_ (in CoreFoundation) 6 40-[SourceEditorViewProxy showCommandLine]_block_invoke at /Users/liang/Projects/Tools/XVim2/XVim2/Xcode/SourceEditorViewProxy.m:662 (in XVim2) 7 +[NSAnimationContext runAnimationGroup:] (in AppKit) 8 +[NSAnimationContext runAnimationGroup:completionHandler:] (in AppKit) 9 -[SourceEditorViewProxy showCommandLine] at /Users/liang/Projects/Tools/XVim2/XVim2/Xcode/SourceEditorViewProxy.m:637 (in XVim2) 10 -[SourceEditorViewProxy _enableAction] at /Users/liang/Projects/Tools/XVim2/XVim2/Xcode/SourceEditorViewProxy.m:85 (in XVim2) 11 -[SourceEditorViewProxy setEnabled:] at /Users/liang/Projects/Tools/XVim2/XVim2/Xcode/SourceEditorViewProxy.m:68 (in XVim2) 12 -[XVimWindow setEnabled:] at /Users/liang/Projects/Tools/XVim2/XVim2/XVim/XVimWindow.m:125 (in XVim2) 13 -[XVimWindow setupAfterEditorViewSetup] at /Users/liang/Projects/Tools/XVim2/XVim2/XVim/XVimWindow.m:63 (in XVim2) 14 -[XVimIDESourceEditorView xvim_setupOnFirstAppearance] at /Users/liang/Projects/Tools/XVim2/XVim2/Xcode/XVimIDESourceEditorView.m:87 (in XVim2) 15 __53-[XVimIDESourceEditorView xvim_viewWillMoveToWindow:]_block_invoke at /Users/liang/Projects/Tools/XVim2/XVim2/Xcode/XVimIDESourceEditorView.m:73 (in XVim2) 16 NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK (in Foundation) 17 -[NSBlockOperation main] (in Foundation) 18 NSOPERATION_IS_INVOKING_MAIN (in Foundation) 19 -[NSOperation start] (in Foundation) 20 NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION (in Foundation) 21 NSOQSchedule_f (in Foundation) 22 _dispatch_block_async_invoke2 (in libdispatch.dylib) 23 _dispatch_client_callout (in libdispatch.dylib) 24 _dispatch_main_queue_callback_4CF (in libdispatch.dylib) 25 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE (in CoreFoundation) 26 __CFRunLoopRun (in CoreFoundation) 27 CFRunLoopRunSpecific (in CoreFoundation) 28 RunCurrentEventLoopInMode (in HIToolbox) 29 ReceiveNextEventCommon (in HIToolbox) 30 _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox) 31 _DPSNextEvent (in AppKit) 32 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit) 33 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit) 34 -[NSApplication run] (in AppKit) 35 NSApplicationMain (in AppKit) 36 start (in libdyld.dylib)

abort() called

webcpu commented 4 years ago

I commented out the lines below to work around it. The command line is gone but it doesn't crash any more, I guess I can live with that for a while.

XVim2/Xcode/SourceEditorViewProxy.m:662 SourceEditorViewProxy showCommandLine

//        [NSAnimationContext runAnimationGroup:^(NSAnimationContext* _Nonnull context) {
//            context.duration = XvimCommandLineAnimationDuration;
//            NSEdgeInsets insets = scrollView.additionalContentInsets;
//            self->_cmdLineBottomAnchor.animator.constant = 0;
//            insets.bottom += XvimCommandLineHeight;
//            scrollView.animator.additionalContentInsets = insets;
//            [scrollView updateAutomaticContentInsets];
//        }
//                    completionHandler:^{
//                        self.commandLine.needsDisplay = YES;
//                    }];
pebble8888 commented 4 years ago

You can use develop branch which has this fix.