Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only show secondary icon for know filenames and extensions #88

Closed
Hirse opened this issue Jul 20, 2015 · 8 comments · Fixed by #91
Closed

Only show secondary icon for know filenames and extensions #88

Hirse opened this issue Jul 20, 2015 · 8 comments · Fixed by #91

Comments

@Hirse
Copy link
Contributor

Hirse commented Jul 20, 2015

The best way to explain is probably by example:
capture
Here I have three files with a secondary icon.
The first one - correctly - because of the combination of filename and file extension is somewhat reserved.
The second one - also correctly - because it has a secondary file extension.
The third one - in my opinion incorrectly - because the svg is not a secondary file extension but just the name of the file.

@cgfrost
Copy link
Contributor

cgfrost commented Jul 20, 2015

To put it another way, you think the first element (the bit before the first dot) of a file name should be ignored unless it's a known file name such as package.json?

@Hirse
Copy link
Contributor Author

Hirse commented Jul 20, 2015

Yes, pretty much.
To be more precise, in a filename with many dots only the part after the second last dot should be considered.

@cgfrost
Copy link
Contributor

cgfrost commented Jul 20, 2015

That change would mean a little more. e.g. foo.js.bar.boo would currently get the extension for a JS file. If we ignore everything before the second from last dot it will only get the default icon. @ivogabe What do you think? (I'm happy to do the work for this change, I have some spare time tomorrow, I don't want to barge in before you though)

@ivogabe
Copy link
Owner

ivogabe commented Jul 21, 2015

I think the behavior proposed by @Hirse is the best. svg.html is probably not a svg file, only a html file and foo.js.bar.boo is probably not a javascript file, so we should give it the default icon. A file like foo.js.bar is comparable to foo.js.php, it can be for instance a .bar / .php file that generates a .js file, so we should give foo.js.bar the default icon as primary icon and .js as secondary.

@cgfrost
Copy link
Contributor

cgfrost commented Jul 21, 2015

@ivogabe OK, do you mind if I make this change and fix the bug in the other issue at the same time. Will be much quicker because I already started playing with this before the bug was raised?

@ivogabe
Copy link
Owner

ivogabe commented Jul 21, 2015

@cgfrost That would be great

@cgfrost
Copy link
Contributor

cgfrost commented Jul 21, 2015

This pull request will fix things. (I'll stop tweeking the pull request as well)

@yvza
Copy link

yvza commented Apr 6, 2017

How about this? http://prnt.sc/eta6rj
@cgfrost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants