Home Download Buy Blog Forum Support

*.sublime-project: folder_exclude_patterns

*.sublime-project: folder_exclude_patterns

Postby ken on Mon Jun 24, 2013 11:19 pm

Hi,

Is there a way to cause folder_exclude_patterns to be anchored to the root directory of the project?

For example, if I have a project directory like this:
this
+ that
. + theOther
that
theOther

I would like to be able to exclude './that' or './theOther' without excluding the children of 'this.'

Anyone know how?

Thanks.
Last edited by ken on Wed Jun 26, 2013 3:43 pm, edited 2 times in total.
ken
 
Posts: 20
Joined: Fri Apr 19, 2013 3:36 am

Re: *.sublime-project: folder_exclude_patterns

Postby drifter on Mon Jun 24, 2013 11:38 pm

Code: Select all
"folder_exclude_patterns": ["root_dir/that","root_dir/theOther"]

where root_dir is the name of the root folder
drifter
 
Posts: 13
Joined: Tue Apr 23, 2013 12:17 pm

Re: *.sublime-project: folder_exclude_patterns

Postby ken on Tue Jun 25, 2013 3:24 pm

Nice! Will try that right away!

Thanks.
ken
 
Posts: 20
Joined: Fri Apr 19, 2013 3:36 am

Re: *.sublime-project: folder_exclude_patterns -- Solved

Postby ken on Tue Jun 25, 2013 3:44 pm

This works nicely, thank you!
ken
 
Posts: 20
Joined: Fri Apr 19, 2013 3:36 am

Re: *.sublime-project: folder_exclude_patterns

Postby ken on Wed Jun 26, 2013 3:53 pm

I'm having a problem with it again.

I have two folders
Code: Select all
"folder_exclude_patterns": [
    "workspace/something",
    "workspace/something-else",
    ...
]


If I want to have "something-else" show up in the side bar, I comment it out and it won't show unless I also comment out "something".

I can't figure out what regex spec is being used here. I've tried \b word boundary for Java, I've tried \>, $, \$, none of that works.

Actually what I would like to find is an end-of-line anchor.

Thanks.
ken
 
Posts: 20
Joined: Fri Apr 19, 2013 3:36 am

Re: *.sublime-project: folder_exclude_patterns

Postby drifter on Wed Jun 26, 2013 6:12 pm

I believe it's not really regex. So no anchors or any of that fun stuff.
Pretty sure the only wildcards that work here are "*" and "?" (standard OS path wildcards).

The behavior you encountered does seem like a bug though, or at the very least an inconsistency and undesirable feature.
I mean, if you just use "something", it will actually leave "something-else" visible. But, it will hide all "something" dirs too, for instance "foo/something", which makes sense but is not good in your first post case.
But I see no logical reason why "bar/something" should hide "bar/something-else" as well. If I wanted that, I would expect to use "bar/something*"

So unless that gets fixed/changed, you have two options - 1) adopt a better folder naming scheme so you don't have this problem (for example, prepend . to folders you want to hide, Linux style), 2) decide on the least of the two negatives and roll with that.
drifter
 
Posts: 13
Joined: Tue Apr 23, 2013 12:17 pm

Re: *.sublime-project: folder_exclude_patterns

Postby ken on Wed Jun 26, 2013 6:59 pm

Ya I thought it was a bug too.

If it's not a regex, then it should automatically anchor to the end of the file name if there's no explicit wildcard.

Unfortunately I'm not in control of the folder names.

I'm trying to use ST2 as a single editor across multiple projects. Some of them start with the same characters. The projects almost all use the same framework so there are massive matches between them, so I want to be able to comment out lines in this file to tell ST2 to ignore any project I'm not interested in at the moment. It's been amazingly good with that, except for these name collisions.

My "safe" alternative is go back to one .sublime-project per development project, and one window per project. It sucks, but until such time as this bug gets fixed I guess it's all I can do.
ken
 
Posts: 20
Joined: Fri Apr 19, 2013 3:36 am

Re: *.sublime-project: folder_exclude_patterns

Postby ken on Wed Jul 03, 2013 3:56 am

Is this automatically entered as a bug, or do I need to do that somewhere?
ken
 
Posts: 20
Joined: Fri Apr 19, 2013 3:36 am

Re: *.sublime-project: folder_exclude_patterns

Postby Kaless1n on Tue Jul 23, 2013 8:07 pm

I have the same problem with similar directory names.
I hope developer reads this topic and fix this bug.
Maybe it is already fixed in Sublime Text 3 beta?
Kaless1n
 
Posts: 1
Joined: Tue Jul 23, 2013 8:05 pm

Re: *.sublime-project: folder_exclude_patterns

Postby ken on Tue Dec 17, 2013 1:31 am

I finally got tired of it and made a hack.

Make a symbolic link to the 'something-else' in my example above, which will not match to any of the other patterns you have.

It's dirty but it works for most of my use cases.

It's crazy, this is just a one-line fix.
ken
 
Posts: 20
Joined: Fri Apr 19, 2013 3:36 am

Next

Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 23 guests