Sublime Forum

Sidebar: Decrease margin of files in open folder

#1

How can I decrease the indent-margin (left) of files in empty folders?

See this screenshot for an illustration of my problem:

Green: Folder inside a folder: margin is small (good)
Red: Files inside a folder: margin is too big (bad)

0 Likes

#2

I think it’s not that the margin is bigger, but that it seems your theme is not showing an icon for the file, making the margin look bigger

0 Likes

#3

This often happens because many of the popular themes add .tmPreferences files that change the theme class name for certain file types. Unfortunately these preferences are not tied to a specific theme, so the preferences change the class name for all themes. If the current theme does not provide an icon for the class name, nothing is shown.

You can test if this is the case by disabling the packages for themes you aren’t using.

1 Like

#4

For me it’s not showing icons for html, php or js files, tried uninstalling and disabling plugins, but so far no luck. It would be nice if there was a fallback, to at least show some sort of default icon.

0 Likes

#5

Can you post a list of installed packages?

0 Likes

#6
"ApacheConf.tmLanguage",
"ASCII Decorator",
"Behave Color Scheme",
"C Improved",
"Charcoal",
"Crontab Syntax",
"DeleteBlankLines",
"DocBlockr",
"Electron Color Scheme",
"Enlightened Color Scheme",
"FileDiffs",
"Git Commit Message Syntax",
"GitCommitMsg",
"GitGutter",
"GitSavvy",
"HTMLBeautify",
"HTTP Spec Syntax",
"Licence Snippets",
"Markdown Preview",
"One Dark Color Scheme",
"OpenGL Shading Language (GLSL)",
"Package Control",
"PackageResourceViewer",
"PostgreSQL Syntax Highlighting",
"Predawn",
"Pretty JSON",
"ScopeHunter",
"SelectUntil",
"SFTP",
"SideBarTools",
"SQLExec",
"SSH Config",
"SublimeLinter",
"SublimeLinter-contrib-eslint",
"SublimeLinter-jshint",
"SublimeLinter-php",
"SublimeLinter-phpcs",
"SublimeLinter-phplint",
"SublimeLinter-phpmd",
"URLEncode"
0 Likes

#7

Who knows, maybe I have some cruft left somewhere, maybe I should purge everything and do a clean install.

0 Likes

#8

Remove it if you don’t use, that should resolve your issue if you prefer default theme.

1 Like

#9

It’s possible to use ST’s Python console to find all .tmPreferences files that specify an icon, and you can then tell from the path which package is causing the conflict. Similar to my idea at https://github.com/sublimehq/Packages/issues/958#issuecomment-298360385, but changing symbolList to icon:

[(file_path, contents) for (file_path, contents) in ((file_path, sublime.load_resource(file_path)) for file_path in sublime.find_resources('*.tmPreferences')) if '<key>icon</key>' in contents]
0 Likes

#10

That was it! I was using the color scheme for a while and forgot it had installed the whole thing, theme included.

0 Likes

#11

Run this in your ST console to see preferences files controlling icons:

import plistlib; prefs = [(fn, plistlib.readPlistFromBytes(sublime.load_binary_resource(fn))) for fn in sublime.find_resources('*.tmPreferences')]; print('\n'.join(["{0}: {1} ({2})".format(d[0], d[1]['scope'], d[1]['settings']['icon']) for d in prefs if 'settings' in d[1] and 'icon' in d[1]['settings']]))
1 Like

#12

Excellent, thanks! Got my icons back.

0 Likes

#13

Thanks guys for pointing me in the right direction.
Turns out the theme I used, Soda, does not support these icons. I have switched to SoDaReloaded now.

0 Likes

#14

You can try A File Icon package to add the icons to Soda theme.

0 Likes

#15

@wbond. @jps: It’s just the same kind of issue I experienced with Kronuz theme and console highlighting recently.

I find it very important to somehow ensure theme specific resources are applied only if the theme is really selected. Not sure how to solve this issue, but it is again and again very annoying and time expensive to search such issues caused by possibly on of hundreds of packages.

From my point of view, icons of the tree may be understood as part of the theme and therefore must be declared inside the theme or need to be understood as differend kind of theme (iconset) which can be selected and changed such as themes and color schemes.

0 Likes