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

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

Closed
OdatNurd opened this issue Sep 13, 2019 · 0 comments
Closed
Labels
Milestone

Comments

@OdatNurd
Copy link

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.

@FichteFoll FichteFoll added this to the 3.2.11 milestone Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants