Skip to content

Edit Color Scheme does not work if the color_scheme setting has no path  #257

@OdatNurd

Description

@OdatNurd

The PackageDev: Edit Current Color Scheme command generates an error dialog if your color_scheme preference is set just to the name of a color scheme file instead of a full resource file path.

image

Looking in PackageDev/plugins_/color_scheme_dev.py, the reason seems to be that the command creates a ResourcePath() based on the value of the setting, and then tries to use it to come up with the appropriate paths. However when the setting doesn't contain a path, this ends up with a filename that's not valid:

        scheme_path = ResourcePath(view.settings().get('color_scheme'))
        self.window.run_command(
            'edit_settings',
            {
                "base_file": '/'.join(("${packages}",) + scheme_path.parts[1:]),
                "user_file": "${packages}/User/" + scheme_path.stem + '.sublime-color-scheme',
                "default": SCHEME_TEMPLATE,
            },
        )

In order for the command to work you need to edit the color scheme preference to include a full package resource spec or use UI: Select Color Scheme to modify the color_scheme setting for you, since that command always uses a full resource filename when it modifies the setting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions