XVimProject / XVim

Xcode plugin for Vim keybindings
MIT License
5.16k stars 595 forks source link

Crashes when using unindent block shortcut while in auto-visual mode upon text selection #372

Open maxponte opened 11 years ago

maxponte commented 11 years ago

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/900170-crashes-when-using-unindent-block-shortcut-while-in-auto-visual-mode-upon-text-selection?utm_campaign=plugin&utm_content=tracker%2F252770&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F252770&utm_medium=issues&utm_source=github).
mblackwell8 commented 11 years ago

Think my issue is similar...

This happens reliably if I, for example, copy a method declaration in a header file (Vjjjy), paste it below (p), change something in the method declaration, select the method (Vjjj), then press Ctrl-I to re-indent.

Oddly it only happens if I paste the method as the last one in the file, but is quite reliable.

Here's Xcode's crash report.

Process: Xcode [32913] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 4.6 (2066) Build Info: IDEApplication-2066000000000000~3 App Item ID: 497799835 App External ID: 13668903 Code Type: X86-64 (Native) Parent Process: launchd [123]

PlugIn Path: /Users/USER/Library/Application Support/Developer/*/XVim PlugIn Identifier: net.JugglerShu.XVim PlugIn Version: 1.01 (1)

Date/Time: 2013-04-24 12:26:13.978 +1000 OS Version: Mac OS X 10.7.5 (11G63b) Report Version: 9

Interval Since Last Report: 88346 sec Crashes Since Last Report: 8 Per-App Interval Since Last Report: 4610925 sec Per-App Crashes Since Last Report: 8 Anonymous UUID: 45A5AB5F-F627-4A48-9740-1E0D137F3C4B

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

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

Application Specific Information: ProductBuildVersion: 4H127 ASSERTION FAILURE in /SourceCache/DVTKit/DVTKit-2076/Framework/Classes/TextCompletion/DVTCompletingTextView.m:1215 Details: Attempt to select an invalid range of text: {2503, 0}. Text length: 2497. (Please file a Radar. OK to Continue from here.) Object: <DVTSourceTextView: 0x402cf0e80> Method: -setSelectedRange: Thread: <NSThread: 0x40010a220>{name = (null), num = 1} Hints: None Backtrace: 0 0x000000010b5d8fba -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:](in IDEKit) 1 0x000000010a88bcf4 _DVTAssertionFailureHandler (in DVTFoundation) 2 0x000000010ac4747c -[DVTCompletingTextView setSelectedRange:](in DVTKit) 3 0x000000010ac6fb38 -[DVTSourceTextView setSelectedRange:](in DVTKit) 4 0x00000001117d7a93 -[DVTSourceTextViewHook setSelectedRange:] at /Volumes/Files/mblackwell8/work/XVim/XVim/DVTSourceTextViewHook.m:73 (in XVim) 5 0x00000001117f09b5 -[XVimSourceView setSelectedRange:] at /Volumes/Files/mblackwell8/work/XVim/XVim/XVimSourceView.m:373 (in XVim) 6 0x00000001117c810b -[XVimVisualEvaluator eval:inWindow:] at /Volumes/Files/mblackwell8/work/XVim/XVim/XVimVisualEvaluator.m:148 (in XVim) 7 0x00000001117f5063 -[XVimWindow handleKeyStroke:] at /Volumes/Files/mblackwell8/work/XVim/XVim/XVimWindow.m:144 (in XVim) 8 0x00000001117f4ae4 -[XVimWindow handleKeyEvent:] at /Volumes/Files/mblackwell8/work/XVim/XVim/XVimWindow.m:106 (in XVim) 9 0x00000001117d7d16 -[DVTSourceTextViewHook keyDown:] at /Volumes/Files/mblackwell8/work/XVim/XVim/DVTSourceTextViewHook.m:91 (in XVim) 10 0x00007fff832ab0fc -[NSWindow sendEvent:](in AppKit) 11 0x00007fff832443a5 -[NSApplication sendEvent:](in AppKit) 12 0x000000010b451dae -[IDEApplication sendEvent:](in IDEKit) 13 0x00007fff831daa0e -[NSApplication run](in AppKit) 14 0x00007fff83456eac NSApplicationMain (in AppKit) 15 0x000000010a7feb6f (in Xcode) 16 0x000000010a7feb00 (in Xcode)

objc[32913]: garbage collection is ON abort() called

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff897d2ce2 __pthread_kill + 10 1 libsystem_c.dylib 0x00007fff83e2d7d2 pthread_kill + 95 2 libsystem_c.dylib 0x00007fff83e1ea7a abort + 143 3 com.apple.dt.IDEKit 0x000000010b5d8a5f +[IDEAssertionHandler _handleAssertionWithLogString:reason:] + 578 4 com.apple.dt.DVTFoundation 0x000000010a88bcf4 _DVTAssertionFailureHandler + 128 5 com.apple.dt.DVTKit 0x000000010ac4747c -[DVTCompletingTextView setSelectedRange:] + 242 6 com.apple.dt.DVTKit 0x000000010ac6fb38 -[DVTSourceTextView setSelectedRange:] + 52 7 net.JugglerShu.XVim 0x00000001117d7a93 -[DVTSourceTextViewHook setSelectedRange:] + 67 (DVTSourceTextViewHook.m:77) 8 net.JugglerShu.XVim 0x00000001117f09b5 -[XVimSourceView setSelectedRange:] + 69 (XVimSourceView.m:376) 9 net.JugglerShu.XVim 0x00000001117c810b -[XVimVisualEvaluator eval:inWindow:] + 155 (XVimVisualEvaluator.m:151) 10 net.JugglerShu.XVim 0x00000001117f5063 -[XVimWindow handleKeyStroke:] + 115 (XVimWindow.m:148) 11 net.JugglerShu.XVim 0x00000001117f4ae4 -[XVimWindow handleKeyEvent:] + 612 (XVimWindow.m:118) 12 net.JugglerShu.XVim 0x00000001117d7d16 -[DVTSourceTextViewHook keyDown:] + 422 (DVTSourceTextViewHook.m:102) 13 com.apple.AppKit 0x00007fff832ab0fc -[NSWindow sendEvent:] + 7430 14 com.apple.AppKit 0x00007fff832443a5 -[NSApplication sendEvent:] + 5593 15 com.apple.dt.IDEKit 0x000000010b451dae -[IDEApplication sendEvent:] + 363 16 com.apple.AppKit 0x00007fff831daa0e -[NSApplication run] + 555 17 com.apple.AppKit 0x00007fff83456eac NSApplicationMain + 867 18 com.apple.dt.Xcode 0x000000010a7feb6f 0x10a7fd000 + 7023 19 com.apple.dt.Xcode 0x000000010a7feb00 0x10a7fd000 + 6912

etc... can't seem to post entire dump