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

User icon double ups (primary and secondary are the same icon) #97

Closed
HookyQR opened this issue Sep 20, 2015 · 2 comments
Closed

User icon double ups (primary and secondary are the same icon) #97

HookyQR opened this issue Sep 20, 2015 · 2 comments

Comments

@HookyQR
Copy link

HookyQR commented Sep 20, 2015

I wanted to change the javascript icon to the nodejs_small icon and discovered that this caused the icon to show up as the main and the secondary icon when secondaries were turned on. I've tracked down the problem. The UserDIctionary,findFIleName function ignores the fileName parameter. This can be fixed by changing the body to the following code:

if (!this.settings[fileName]) return undefined;
if (!this.settings[fileName].ext) return this.settings[fileName];
if (this.settings[fileName].ext.indexOf(extension)===-1) return undefined;
return this.settings[fileName];

This has the handy side effect that you can specify secondary icons for specific files, just as are done in the presets, such as:

{ "gruntfile":
    { "ext"  : ["js","coffee"],
      "icon" : "devicons devicons-grunt",
      "color": "#fba919",
      "size" : 12
    }
}

With the second line as it is, any filename (of any extension) will be 'seconded' if the ext element isn't provided. Change to return undefined if this is undesireable.

Love the extension by the way, makes things much nicer to look at.

@HookyQR
Copy link
Author

HookyQR commented Sep 20, 2015

Of course, return would do. Think I was being a little over explicit there.

@ivogabe
Copy link
Owner

ivogabe commented Sep 26, 2015

Thanks for reporting, that was indeed a bug. I've only changed the extension to the fileName. Limiting the icon to certain extensions sounds useful, though I'm not yet sure what the best design would be. I might implement such feature later.

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

No branches or pull requests

2 participants