tree folders on top
This option doesn't work properly. Often files jump to top randomly (when file is added/deleted) etc on Lion
Thanks for the report. I'll look into it as soon as I have the chance.
This pull request will fix the problem in most cases: https://github.com/fdintino/projectplus/pull/3
Actually, inspired by your pull requests, I started trying to tackle this one. Re-sorting on focus is one part, but the project pane also has to re-sort when files or a folder are added or removed via right-click, or when files are dragged from one place to another. That's all done now, but what I've learned is that [NSOutlineView reloadData] isn't thread safe, so I need to implement some sort of locking mechanism to prevent race condition bugs caused by overlapping calls to the sort and reloadData methods.
As far as I know, nothing in Cocoa is thread safe, at least not the GUI. There's the @synchronized statement and the
[NSObject performSelectorOnMainThread:withObject:waitUntilDone:] method.
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nsobject_Class/Reference/Reference.html
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocThreading.html#//apple_ref/doc/uid/TP30001163-CH19-SW1
That's my understanding too. What complicates matters is that [NSOutlineView reloadData] can be (and is) called from outside of ProjectPlus, since we're using swizzle methods to monkey patch. I've used @synchronized in the SCM code for this purpose, though I believe there is a bit of a performance hit with that. Ideally I'd like to make the sorting atomic so that I don't need to manage the threads at all.
Are items added to the outline view from other threads than the main thread? If reloadData is only called on the main thread there is no problem. If reloadData is called from some other thread then there already was a problem?