Skip to content

Package Settings menu entries fail with res://Packages/mdtoc/... could not be opened #4

@AntonioGHub

Description

@AntonioGHub

Thanks for your great addon! Here a problem I am experiencing:

Environment

  • Sublime Text 4, build 4200 (macOS, Darwin 25.3.0)
  • Package Control–installed plugin: Markdown Table of Contents v1.2.1 (released 2025-12-26)
  • codeleventh/mdtoc
  • Installed archive: ~/Library/Application Support/Sublime Text/Installed Packages/Markdown Table of Contents.sublime-package

Expected behavior

Clicking Preferences → Package Settings → Markdown Table of Contents → Settings – Default (or Key Bindings – Default) opens the plugin's default settings on the left and the user's override file on the right via Sublime's edit_settings command.

Actual behavior

Both menu entries fail with a popup:

The settings file "res://Packages/mdtoc/mdtoc.sublime-settings" could not be opened

(and analogously for Default.sublime-keymap.)

Root cause

Main.sublime-menu hard-codes the old package name mdtoc in its ${packages} paths:

{
    "caption": "Settings - Default",
    "command": "edit_settings",
    "args": {
        "base_file": "${packages}/mdtoc/mdtoc.sublime-settings"
    }
},
{
    "caption": "Key Bindings - Default",
    "command": "edit_settings",
    "args": {
        "base_file": "${packages}/mdtoc/Default.sublime-keymap",
    }
}

But the plugin is distributed via Package Control under the display name Markdown Table of Contents, so the archive is Markdown Table of Contents.sublime-package. Sublime resolves ${packages}/<Name>/… using the .sublime-package file's base name — i.e. Packages/Markdown Table of Contents/, not Packages/mdtoc/. The referenced resources exist in the installed zip, just under a different package name, so they cannot be found at the hard-coded path.

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