paulpflug / foldername-tabs

Adds foldernames to tabs..
MIT License
16 stars 6 forks source link

Allow folder levels #9

Closed redfellow closed 7 years ago

redfellow commented 8 years ago

I'd like to be able to select levels of subfolders shown.

With levels: 2 it would display ..element-name/skins/ instead of ../skins/ etc.

Or perhaps it could support folding single item folders like tree-view does, so that given folder structure:

skins
    html
        filename.html

tree-view with folding enabled shows it as:

skins/html
    filename.html

And in these cases the plugin would also show ..skins/html

paulpflug commented 8 years ago

hey,

in Settings > Packages > Settings on the foldername-tabs package there is an option Maximum path length to limit the overall character limit, up to this limit all subfolders are shown. I have chosen the over Maximum folder depth to optimise the information shown. (so many short folders should always show) - There is also an option to shorten the folder names.

I think I will update the readme ;)

regarding the tree-view, I think I can't do that currently, as the tab-size is fixed.

ProLoser commented 7 years ago

Instead of setting this to 0 in order to show the path, what you should do is show the path starting from the right, not the left. Then if the path exceeds the maximum, you cut it down to the maximum folder path that can fit. This right now behaves very binarily. It either shows the whole path if it fits or only the parent folder if it doesn't fit. It makes no effort to show as many folders as it can before it fits.

redfellow commented 7 years ago

Using Maximum path length has no effect. If i set it to 0 I can see elements/calendar/event, with value from 1, 50, 100, 1000 I can only see ../../event. What the plugin lacks is a setting for "FolderDepth".

FolderDepth of 1 would show: ../../event FolderDepth of 2 would show: ../calendar/event FolderDepth of 3 would show: elements/calendar/event etc.

In my usecase, seeing "elements" is always redundant, but seeing "calendar" is important. Now I can only show too much or too little. I've tested all existing setting configurations.

redfellow commented 7 years ago

Didn't mean to close.

ProLoser commented 7 years ago

I have been digging through this code but I'm having difficulty understanding the logic https://github.com/paulpflug/foldername-tabs/blob/master/lib/foldername-tabs.coffee#L52 The answer to our problem is in those subsequent lines

paulpflug commented 7 years ago

I found a bug, maximum path length should work now: for your example elements/calendar/event a path length of 23 should show the full path and 22 should show ../calendar/event If you add a folder length limit of 6 it should show elmnts/calndr/event

please report back

redfellow commented 7 years ago

Will test tomorrow at work.

paulpflug commented 7 years ago

I assume it works now for you :+1:

redfellow commented 7 years ago

It's a lot better now, but I'd still love if we could limit the amount of folders shown from end to beginning. Now the plugin seems to be forcing one of the earlier root folders into the mix for a reason that is not obvious to me.

A few examples of what I am seeing:

(Trunk is project folder) Full path: trunk/elements/articles/article/menu/root.xml

Foldername tabs with 0 max length (OK): elements/articles/article/menu Foldername tabs with 18 max length (NOT OK): elements/../menu Foldername tabs with 25 max length (NOT OK): elements/article//menu Foldername tabs with 35 max length (NOT OK): elements/articles/article//menu

There's a weird double forward slash and the elements folder seems to have high priority, even though the priority should go downwards from the menu folder.

What I feel I should be seeing is: Max length 18: ../article/menu Max length 25: ../articles/article/menu Max length 35: elements/articles/article/menu

redfellow commented 7 years ago

I suppose you won't revisit this?