protocool / AckMate

TextMate plugin (Cocoa) shell for running 'ack'
MIT License
723 stars 34 forks source link

If project has multiple folders, AckMate appears to search from their common ancestor #19

Closed sbleon closed 13 years ago

sbleon commented 13 years ago

I have a project into which I've dragged the folders ~/foo/bar/ and ~/foo/baz/. When I search the project with AckMate, I also get results from ~/foo/blah/. It appears that AckMate is determining that the common ancestor of my folders is ~/foo/ and is searching its contents.

The command line version of ack appears to handle this correctly. I do "cd ~/foo; ack expression bar baz", I do not get results from blah.

protocool commented 13 years ago

Ackmate uses the TM_PROJECT_DIRECTORY variable supplied by TextMate.

sbleon commented 13 years ago

Thanks for the reply. This behavior is pretty unintuitive and basically means I can't use multiple root folders in my TextMate projects without giving up AckMate. Is there any other mechanism that supplies a list of top-level folders instead a single root?

protocool commented 13 years ago

I'm afraid not - the mechanisms you're talking about create a virtual project filesystem that doesn't match the actual filesystem.

I can't say if this is a popular feature but I do recall seeing the TextMate author mention something about getting rid of those types of projects from TM2.

Regardless, supporting your project structure would require that I traverse all of the nodes in your drawer and map those to their real filesystem locations for Ack to search. After that I'd have to stitch Ack's results back into a view that matches how your projects 'folders' are set up.

It's non-trivial and I'm not even sure if that information is available to plugins in the first place.

sbleon commented 13 years ago

OK. I just wanted to make sure there was no easy fix to this. I'll stick to single-rooted projects for now. Thanks!