omz/Dash-Plugin-for-Xcode — pull request #12 by Kapeli (2013-07-10 02:51:30+00:00)
Title: Get selected symbol correctly when code is folded

This is related to https://github.com/omz/Dash-Plugin-for-Xcode/issues/7#issuecomment-20673109.

What happens is that if the user has code folded somewhere above the place he ALT+Clicks, the string range does not match. I think that Xcode does something funny with its string storage when it's folding code and _temporaryLinkRanges no longer gives the correct string ranges.

This bug only occurs on ALT+Click and not when the "Quick Help with Selected Item" menu item called (om_showQuickHelp). What I did to fix the bug was to stop swizzling textView:didClickOnTemporaryLinkAtCharacterIndex:event:isAltEvent completely.

Question: did you have a reason for swizzling textView:didClickOnTemporaryLinkAtCharacterIndex:event:isAltEvent? It seems to work perfectly fine without it.