Skip to content

Installing Timeless can break icons in other themes #6

@iccir

Description

@iccir

Installing Timeless can result in blank file icons in other themes.

Steps to reproduce

  1. Start Sublime Text in safe mode.
  2. Install Timeless. Do not set Timeless as the active theme.
  3. Open a folder with .js files. The .js files will have blank sidebar icons.

Why?

Sublime Text's implementation of file icons is very fragile.

First, it looks up the syntax scope for a file extension from a mapping. This mapping is created from:

  • The file_extension key of .sublime-syntax files
  • The fileTypes key of .tmLanguage files
  • The extensions key of a .sublime-settings file for a language.

Next, it looks up the file icon name for the mapped scope. It does so by examining all .tmPreferences file across all packages and picking the first one with an icon setting defined.

If a file with the specified name is found in the active theme, it is displayed. If not, no icon is drawn. Sublime Text does not implement any kind of fallback icon.

This is a long-standing issue first documented in 2018.

The path forward

  • In order to be a good citizen of the ecosystem, Timeless should not break other themes. The .tmPreferences files located in icons/ need to be removed. This will have the side effect of disabling file icons for JavaScript, Python, etc.

  • AFileIcon is the de facto package for dealing with file icons. Timeless needs to match its icon names to those in AFileIcon and add a .supports-a-file-icon-customization file.

  • For users that do not want to install AFileIcon, Timeless should provide a mechanism to re-enable its custom file icons. This mechanism should be manually invoked by the user (I do not believe that a theme package should run code automatically).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions