stefanceriu / SCXcodeMiniMap

Sublime Text like Minimap for Xcode
GNU General Public License v3.0
1.03k stars 87 forks source link

Refactoring and "Show/Hide" menu. #9

Closed jegnux closed 11 years ago

jegnux commented 11 years ago

Huge refactoring to use a NSScrollView subclass. It's more clear and avoid use of associated objects. More over, it permits to each mini map view to subscribe to show/hide notifications.

Because, yes, it add a "Show Mini Map" item menu.

stefanceriu commented 11 years ago

Wow, this looks awesome. I'll merge it in as soon as I get a chance to look over it properly. Thank you again :)

jegnux commented 11 years ago

You're welcome. I've made the refactoring maybe in an "arbitrary" way. But I thought that was necessary for future maintainability. Feel free to merge and re-organize and re-facotorize at your convenience. :)

jegnux commented 11 years ago

Oups, there is actually a bug with large files (selection view goes away... :-/ )

I'll send you a pull request later.

stefanceriu commented 11 years ago

Found some issues:

stefanceriu commented 11 years ago

Saw your message too late .. Sweet, I'll be on the lookout for any other bugs in the mean time.

stefanceriu commented 11 years ago

Thank you and great work, looking through your code is a pleasure :)

I've been trying to figure out why the original solution didn't behave correctly (especially the selection view auto-resizing when showing the console) but ended up with nothing. Do you have any more insight by any chance?

Oh and I took the liberty of moving the menu item to the view Menu and switching from checkmarks to different titles (just to go along better with the other options in there). Hope you don't mind :)

jegnux commented 11 years ago

I've been trying to figure out why the original solution didn't behave correctly (especially the selection view auto-resizing when showing the console) but ended up with nothing. Do you have any more insight by any chance?

The problem was the fact that the selectionView was a subview of the MiniMap(scroll)View. Now it's a subview of the textview and it should works great.

Oh and I took the liberty of moving the menu item to the view Menu and switching from checkmarks to different titles (just to go along better with the other options in there). Hope you don't mind :)

I don't mind at all :) In fact at first I wanted to put it in the "Editor" menu with the "Show / Hide" behavior. But i didn't success so I put it in the Edit menu along with other plugins menu items. And I noticed that other plugins use the "Show" + state behavior, so I did the same.